marshaler

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MarshalError

type MarshalError struct {
	Type reflect.Type
	Err  error
}

MarshalError represents an error from calling a Marshal method.

func (*MarshalError) Error

func (e *MarshalError) Error() string

func (*MarshalError) Unwrap

func (e *MarshalError) Unwrap() error

Unwrap returns the underlying error.

type Marshaler

type Marshaler interface {
	Marshal(any) ([]byte, error)
	Unmarshal([]byte, any) error
}

Marshaler is the interface implemented by types that can marshal and unmarshal any value into bytes.

type MsgpackMarshaler

type MsgpackMarshaler struct{}

MsgpackMarshaler is a default marshaler that uses msgpack for marshaling and unmarshaling.

func (*MsgpackMarshaler) Marshal

func (m *MsgpackMarshaler) Marshal(v any) ([]byte, error)

Marshal returns the binary encoding of any value.

func (*MsgpackMarshaler) Unmarshal

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

Unmarshal decodes the binary data.

type UnmarshalError

type UnmarshalError struct {
	Type reflect.Type
	Err  error
}

UnmarshalError represents an error from calling an Unmarshal method.

func (*UnmarshalError) Error

func (e *UnmarshalError) Error() string

func (*UnmarshalError) Unwrap

func (e *UnmarshalError) Unwrap() error

Unwrap returns the underlying error.

Jump to

Keyboard shortcuts

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