encoder

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

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

func TestSymmetry

func TestSymmetry(t *testing.T, value any)

TestSymmetry checks if a type can be marshalled and unmarshalled with no issues

func Unmarshal

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

Unmarshal decodes param v from []byte b

Types

type Decoder added in v0.3.0

type Decoder interface {
	Decode(v any) error
}

func NewDecoder added in v0.3.0

func NewDecoder(r io.Reader) Decoder

NewDecoder returns a new decoder that reads from r

type Encoder added in v0.3.0

type Encoder interface {
	Encode(v any) error
}

func NewEncoder added in v0.3.0

func NewEncoder(w io.Writer) Encoder

NewEncoder returns a new encoder that writes to w

Jump to

Keyboard shortcuts

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