Documentation
¶
Overview ¶
This file implements the CBOR specification see: https://www.rfc-editor.org/rfc/rfc8949.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotWellFormedCBOR = fmt.Errorf("not well-formed (%w)", common.ErrBadInput)
Functions ¶
Types ¶
type AdditionalInfo ¶
type AdditionalInfo byte
5 least significant bits of the first byte of a CBOR encoding. mask: 0b000_11111
const ( OneByteArgument AdditionalInfo = 24 TwoByteArgument AdditionalInfo = 25 FourByteArgument AdditionalInfo = 26 EightByteArgument AdditionalInfo = 27 NoArgument AdditionalInfo = 31 )
type DataItem ¶
type DataItem struct {
MajorType
AdditionalInfo
// variably sized argument for the additional info.
Argument [8]byte
// optional content of the CBOR encoding
Content []byte
Children []*DataItem
}
func DataItemFromBytes ¶
func NewDataType ¶
type MajorType ¶
type MajorType byte
3 most significant bits of the first byte of a CBOR encoding. mask: 0b111_00000 see: https://www.rfc-editor.org/rfc/rfc8949.html#name-major-types
type SimpleValue ¶
type SimpleValue AdditionalInfo
https://www.rfc-editor.org/rfc/rfc8949.html#name-floating-point-numbers-and-
const ( SimpleValue_false SimpleValue = 20 SimpleValue_true SimpleValue = 21 SimpleValue_null SimpleValue = 22 SimpleValue_undefined SimpleValue = 23 SimpleValue_extended SimpleValue = 24 SimpleValue_float16 SimpleValue = 25 SimpleValue_float32 SimpleValue = 26 SimpleValue_float64 SimpleValue = 27 SimpleValue_reserved_1 SimpleValue = 28 SimpleValue_reserved_2 SimpleValue = 29 SimpleValue_reserved_3 SimpleValue = 30 SimpleValue_break SimpleValue = 31 )
Click to show internal directories.
Click to hide internal directories.