Documentation
¶
Index ¶
- Constants
- func LookupExtensionFn(t reflect.Type) (handleDecFn, error)
- func RegisterExtensionFn(t reflect.Type, fn handleDecFn) error
- func RegisterTagExtensionFn(tagInfo uint64, fn handleTagDecFn) error
- type CBORMIME
- type CanonicalModeError
- type Composer
- type Decoder
- type Encoder
- type InvalidDecodeError
- type Major
- type Parser
- type ParserErr
- type StrictModeError
Constants ¶
const ( URI reflect.Kind MIME )
type constants used on blind decode
Variables ¶
This section is empty.
Functions ¶
func LookupExtensionFn ¶
Lookup for a registered function that handles the given type decode
func RegisterExtensionFn ¶
Registers a new function to hanle decode of extensions
func RegisterTagExtensionFn ¶
Registers a new funtion to handle decode of tag extensions
Types ¶
type CanonicalModeError ¶
type CanonicalModeError struct {
Msg string
}
A CanonicalModeError describes an invalid operation that violates the section 3.9. Canonical CBOR definition of the RFC7049
func NewCanonicalModeError ¶
func NewCanonicalModeError(msg string) *CanonicalModeError
func (*CanonicalModeError) Error ¶
func (e *CanonicalModeError) Error() string
type Composer ¶
type Composer struct {
// contains filtered or unexported fields
}
Composes a 'data item'
func NewComposer ¶
Create a new Composer with the given io.Writer and returns back it's address
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
A Decoder reads and decode CBOR objects from an input stream.
func NewDecoder ¶
NewDecoder returns a new decoder that reads from r.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
An Encoder writes and encode CBOR objects to an output stream
func NewEncoder ¶
NewEncoder returns a new encoder that write to w
type InvalidDecodeError ¶
An InvalidDecoderError describes an invalid argument passed to Decode (The argument to Decode must be a non nil pointer)
func (*InvalidDecodeError) Error ¶
func (e *InvalidDecodeError) Error() string
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parses a 'data item' and checks it's well-formedness
It defines an internal buffer that is used to check the well-formedness of the 'data item' and to store data to be processed later
type ParserErr ¶
type ParserErr struct {
Msg string
}
errors returned by the parser
func NewParseErr ¶
creates a new ParseErr component and return it back
type StrictModeError ¶
type StrictModeError struct {
Msg string
}
An StrictModeError describes an invalid operation that violates the section 3.10. Strict Mode definition of the RFC7049
func NewStrictModeError ¶
func NewStrictModeError(msg string) *StrictModeError
func (*StrictModeError) Error ¶
func (e *StrictModeError) Error() string