cbor

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: AGPL-3.0 Imports: 2 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 Encoder

type Encoder struct{}

func NewEncoder

func NewEncoder() *Encoder

func (*Encoder) Decode

func (e *Encoder) Decode(b []byte, val interface{}) error

func (*Encoder) Encode

func (e *Encoder) Encode(val interface{}) ([]byte, error)

func (*Encoder) MustDecode

func (e *Encoder) MustDecode(b []byte, val interface{})

func (*Encoder) MustEncode

func (e *Encoder) MustEncode(val interface{}) []byte

Jump to

Keyboard shortcuts

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