fxamacker

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v any) ([]byte, error)

Marshal returns encoding of param v

func RegisterType

func RegisterType(rType reflect.Type) error

RegisterType gives a unique CBOR tag to a type. Used by the CBOR entry point during utils/cbor/registry initialization.

func Unmarshal

func Unmarshal(b []byte, v any) error

Unmarshal decodes param v from []byte b

func UnmarshalFirst

func UnmarshalFirst(b []byte, v any) ([]byte, error)

UnmarshalFirst decodes the first CBOR data item into param v and returns the remaining bytes

func UnmarshalStrict

func UnmarshalStrict(b []byte, v any) error

UnmarshalStrict decodes without type tags and fails on a wire key with no matching field. Only projection drift tests need it.

Types

type Encoder

type Encoder interface {
	Encode(v any) error
}

func NewEncoder

func NewEncoder(w io.Writer) Encoder

NewEncoder returns a new encoder that writes to w

type RawMessage

type RawMessage []byte

RawMessage is an item that is already CBOR encoded.

func (RawMessage) MarshalCBOR

func (m RawMessage) MarshalCBOR() ([]byte, error)

Returns the same bytes

func (*RawMessage) UnmarshalCBOR

func (m *RawMessage) UnmarshalCBOR(data []byte) error

Creates a copy of the bytes

type SelfDecoder

type SelfDecoder interface {
	UnmarshalCBOR([]byte) error // fxamacker
}

SelfDecoder is the hook a type implements to read its own encoding.

type SelfEncoder

type SelfEncoder interface {
	MarshalCBOR() ([]byte, error) // fxamacker
}

SelfEncoder is the hook a type implements to write its own encoding.

Jump to

Keyboard shortcuts

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