cbor

package
v0.23.6 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: AGPL-3.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EncMode = func() cbor.EncMode {
	options := cbor.CoreDetEncOptions()

	options.Time = cbor.TimeRFC3339Nano
	encMode, err := options.EncMode()
	if err != nil {
		panic(fmt.Errorf("could not extract encoding mode: %w", err))
	}
	return encMode
}()

"For best performance, reuse EncMode and DecMode after creating them." [1] [1] https://github.com/fxamacker/cbor

Functions

This section is empty.

Types

type Codec added in v0.23.2

type Codec struct{}

func (*Codec) NewDecoder added in v0.23.2

func (c *Codec) NewDecoder(r io.Reader) encoding.Decoder

func (*Codec) NewEncoder added in v0.23.2

func (c *Codec) NewEncoder(w io.Writer) encoding.Encoder

type Marshaler added in v0.23.2

type Marshaler struct{}

func NewMarshaler added in v0.23.2

func NewMarshaler() *Marshaler

func (*Marshaler) Marshal added in v0.23.2

func (m *Marshaler) Marshal(val interface{}) ([]byte, error)

func (*Marshaler) MustMarshal added in v0.23.2

func (m *Marshaler) MustMarshal(val interface{}) []byte

func (*Marshaler) MustUnmarshal added in v0.23.2

func (m *Marshaler) MustUnmarshal(b []byte, val interface{})

func (*Marshaler) Unmarshal added in v0.23.2

func (m *Marshaler) Unmarshal(b []byte, val interface{}) error

Jump to

Keyboard shortcuts

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