encoding

package
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2021 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(value Encodable) ([]byte, error)

Encode encodes an encodable to CBOR, using the best available path for writing to CBOR

Types

type Decoder

type Decoder interface {
	DecodeFromCbor([]byte) (Encodable, error)
}

Decoder is CBOR decoder for a given encodable type

func NewDecoder

func NewDecoder(decodeType Encodable) (Decoder, error)

NewDecoder creates a new Decoder that will decode into new instances of the given object type. It will use the decoding that is optimal for that type It returns error if it's not possible to setup a decoder for this type

type Encodable

type Encodable interface{}

Encodable is an object that can be written to CBOR and decoded back

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL