Documentation
¶
Overview ¶
Package cbor wraps github.com/fxamacker/cbor/v2 as a codec.Codec implementation. fxamacker exposes an Encoder and Decoder that stream individual CBOR items, so this codec also implements StreamingCodec.
Package cbor — range 0.3.6.* (ADR 0005 service/codec/cbor block).
Package cbor — adapts fxamacker's *Decoder to codec.Decoder.
Package cbor — adapts fxamacker's *Encoder to codec.Encoder.
Package cbor — declares the sentinel *errs.Error values for CBOR.
Index ¶
Constants ¶
const CodeCBORMarshalFailed errs.Code = 0x00_03_06_01 // 0.3.6.1
CodeCBORMarshalFailed identifies a failure inside fxamacker/cbor/v2.Marshal.
const CodeCBORUnmarshalFailed errs.Code = 0x00_03_06_02 // 0.3.6.2
CodeCBORUnmarshalFailed identifies a failure inside fxamacker/cbor/v2.Unmarshal.
Variables ¶
var ( // MarshalFailed wraps a failure from fxamacker/cbor/v2.Marshal. MarshalFailed = errs.Define(CodeCBORMarshalFailed, "MARSHAL_FAILED", "CBOR encoding failed", "service/codec/cbor: github.com/fxamacker/cbor/v2.Marshal returned an error") // UnmarshalFailed wraps a failure from fxamacker/cbor/v2.Unmarshal. UnmarshalFailed = errs.Define(CodeCBORUnmarshalFailed, "UNMARSHAL_FAILED", "CBOR decoding failed", "service/codec/cbor: github.com/fxamacker/cbor/v2.Unmarshal returned an error") )
var ( //: register the singleton and expose it as a typed package var. Codec codec.Codec = codec.Register(&cborCodec{}) )
Package-level state: the codec singleton plus the hoisted MIME / extension tables (hoisted).
Functions ¶
Types ¶
This section is empty.