module Amber::Schema::CBOR

Extended Modules

Defined in:

amber/schema/cbor.cr

Constant Summary

MAX_BODY_BYTES = 1048576
MAX_DEPTH = 32
MAX_ITEMS = 16384
MAX_TEXT_BYTES = 1048576

Instance Method Summary

Instance Method Detail

def decode_object(io : IO, max_document_body_bytes : Int32 | Nil = nil) : Hash(String, JSON::Any) #

Decodes a CBOR map from io. With max_document_body_bytes, a body longer than that raises Amber::Exceptions::ParameterLimitExceeded, checked before any declared length is allocated.


[View source]
def encode(data : Hash(String, JSON::Any)) : Bytes #

[View source]
def write_bytes(io : IO, value : Bytes) : Nil #

[View source]
def write_head(io : IO, major : UInt8, value : UInt64) : Nil #

[View source]
def write_int(io : IO, value : Int64) : Nil #

[View source]
def write_json(io : IO, value : JSON::Any) : Nil #

[View source]
def write_text(io : IO, value : String) : Nil #

[View source]