# Functions
CanonicalEncOptions returns EncOptions for "Canonical CBOR" encoding, defined in RFC 7049 Section 3.9 with the following rules:
1.
CoreDetEncOptions returns EncOptions for "Core Deterministic" encoding, defined in RFC 7049bis with the following rules:
1.
CTAP2EncOptions returns EncOptions for "CTAP2 Canonical CBOR" encoding, defined in CTAP specification, with the following rules:
1.
Marshal returns the CBOR encoding of v using default encoding options.
No description provided by the author
NewDecoder returns a new decoder that reads and decodes from r using the default decoding options.
NewEncoder returns a new encoder that writes to w using the default encoding options.
NewTagSet returns TagSet (safe for concurrency).
PreferredUnsortedEncOptions returns EncOptions for "Preferred Serialization" encoding, defined in RFC 7049bis with the following rules:
1.
Unmarshal parses the CBOR-encoded data into the value pointed to by v using default decoding options.
Valid checks whether the CBOR data is complete and well-formed.
# Constants
BigIntConvertNone makes big.Int encode to CBOR bignum (tag 2 or 3) without converting it to another CBOR type.
BigIntConvertShortest makes big.Int encode to CBOR integer if value fits.
DecTagIgnored makes decoder ignore tag number (skips if present).
DecTagOptional makes decoder verify tag number if it's present.
DecTagRequired makes decoder verify tag number and tag number must be present.
DupMapKeyEnforcedAPF enforces detection and rejection of duplicate map keys.
DupMapKeyQuiet doesn't enforce duplicate map key.
EncTagNone makes encoder not encode tag number.
EncTagRequired makes encoder encode tag number.
ExtraDecErrorNone indicates no extra error condition.
ExtraDecErrorUnknownField indicates error condition when destination Go struct doesn't have a field matching a CBOR map key.
IndefLengthAllowed allows indefinite length items.
IndefLengthForbidden disallows indefinite length items.
InfConvertFloat16 always converts Inf to lossless IEEE binary16 (float16).
InfConvertNone never converts (used by CTAP2 Canonical CBOR).
IntDecConvertNone affects how CBOR int (major type 0 and 1) decodes to Go interface{}.
IntDecConvertSigned affects how CBOR int (major type 0 and 1) decodes to Go interface{}.
MapKeyByteStringFail affects how a CBOR byte string as a map key is decoded.
MapKeyByteStringWrap affects how a CBOR byte string as a map key is decoded.
NaNConvert7e00 always encodes NaN to 0xf97e00 (CBOR float16 = 0x7e00).
NaNConvertNone never modifies or converts NaN to other representations (float64 NaN stays float64, etc.
NaNConvertPreserveSignal converts NaN to the smallest form that preserves value (quiet bit + payload) as described in RFC 7049bis Draft 12.
NaNConvertQuiet always forces quiet bit = 1 and shortest form that preserves NaN payload.
ShortestFloat16 specifies float16 as the shortest form that preserves value.
ShortestFloatNone makes float values encode without any conversion.
SortBytewiseLexical causes map keys or struct fields to be sorted in the bytewise lexicographic order of their deterministic CBOR encodings.
SortCanonical is used in "Canonical CBOR" encoding in RFC 7049 3.9.
SortCoreDeterministic is used in "Core Deterministic Encoding" in RFC 7049bis.
SortCTAP2 is used in "CTAP2 Canonical CBOR".
SortLengthFirst causes map keys or struct fields to be sorted such that: - If two keys have different lengths, the shorter one sorts earlier; - If two keys have the same length, the one with the lower value in (byte-wise) lexical order sorts earlier.
SortNone means no sorting.
TagsAllowed allows CBOR tags.
TagsForbidden disallows CBOR tags.
TimeRFC3339 causes time.Time to be encoded as RFC3339 formatted string with second precision.
TimeRFC3339Nano causes time.Time to be encoded as RFC3339 formatted string with nanosecond precision.
TimeUnix causes time.Time to be encoded as epoch time in integer with second precision.
TimeUnixDynamic causes time.Time to be encoded as integer if time.Time doesn't have fractional seconds, otherwise float-point rounded to microsecond precision.
TimeUnixMicro causes time.Time to be encoded as epoch time in float-point rounded to microsecond precision.
# Structs
No description provided by the author
Decoder reads and decodes CBOR values from io.Reader.
DecOptions specifies decoding options.
DupMapKeyError describes detected duplicate map key in CBOR map.
Encoder writes CBOR values to io.Writer.
EncOptions specifies encoding options.
IndefiniteLengthError indicates found disallowed indefinite length items.
InvalidUnmarshalError describes an invalid argument passed to Unmarshal.
MaxArrayElementsError indicates exceeded max number of elements for CBOR arrays.
MaxMapPairsError indicates exceeded max number of key-value pairs for CBOR maps.
MaxNestedLevelError indicates exceeded max nested level of any combination of CBOR arrays/maps/tags.
RawTag represents CBOR tag data, including tag number and raw tag content.
SemanticError is a description of a CBOR semantic error.
SyntaxError is a description of a CBOR syntax error.
Tag represents CBOR tag data, including tag number and unmarshaled tag content.
TagOptions specifies how encoder and decoder handle tag number.
TagsMdError indicates found disallowed CBOR tags.
UnknownFieldError describes detected unknown field in CBOR map when decoding to Go struct.
UnmarshalTypeError describes a CBOR value that can't be decoded to a Go type.
UnsupportedTypeError is returned by Marshal when attempting to encode value of an unsupported type.
WrongTagError describes mismatch between CBOR tag and registered tag.
# Interfaces
DecMode is the main interface for CBOR decoding.
EncMode is the main interface for CBOR encoding.
Marshaler is the interface implemented by types that can marshal themselves into valid CBOR.
TagSet is an interface to add and remove tag info.
Unmarshaler is the interface implemented by types that wish to unmarshal CBOR data themselves.
# Type aliases
BigIntConvertMode specifies how to encode big.Int values.
DecTagMode specifies how decoder handles tag number.
DupMapKeyMode specifies how to enforce duplicate map key.
EncTagMode specifies how encoder handles tag number.
ExtraDecErrorCond specifies extra conditions that should be treated as errors.
IndefLengthMode specifies whether to allow indefinite length items.
InfConvertMode specifies how to encode Infinity and overrides ShortestFloatMode.
IntDecMode specifies which Go int type (int64 or uint64) should be used when decoding CBOR int (major type 0 and 1) to Go interface{}.
MapKeyByteStringMode specifies whether to use a wrapper object for byte strings.
NaNConvertMode specifies how to encode NaN and overrides ShortestFloatMode.
RawMessage is a raw encoded CBOR value.
ShortestFloatMode specifies which floating-point format should be used as the shortest possible format for CBOR encoding.
SortMode identifies supported sorting order.
TagsMode specifies whether to allow CBOR tags.
TimeMode specifies how to encode time.Time values.