marshaller

package
v1.188.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

This section is empty.

Types

type GOB added in v1.158.0

type GOB struct{}

GOB for marshaller.

func NewGOB added in v1.158.0

func NewGOB() *GOB

NewJSON for marshaller.

func (*GOB) Marshal added in v1.158.0

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

func (*GOB) Unmarshal added in v1.158.0

func (m *GOB) Unmarshal(data []byte, v any) error

type JSON added in v1.141.0

type JSON struct{}

JSON for marshaller.

func NewJSON added in v1.141.0

func NewJSON() *JSON

NewJSON for marshaller.

func (*JSON) Marshal added in v1.141.0

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

func (*JSON) Unmarshal added in v1.141.0

func (m *JSON) Unmarshal(data []byte, v any) error

type Map added in v1.188.0

type Map struct {
	// contains filtered or unexported fields
}

Map of marshaller.

func NewMap added in v1.188.0

func NewMap() *Map

NewMap for marshaller.

func (*Map) Get added in v1.188.0

func (f *Map) Get(kind string) Marshaller

Get from kind.

func (*Map) Register added in v1.188.0

func (f *Map) Register(kind string, m Marshaller)

Register kind and marshaller.

type Marshaller

type Marshaller interface {
	// Marshal value.
	Marshal(v any) ([]byte, error)

	// Unmarshal data to value.
	Unmarshal(data []byte, v any) error
}

Marshaller allows to have different ways to marshal/unmarshal.

type None added in v1.188.0

type None struct{}

None for marshaller.

func NewNone added in v1.188.0

func NewNone() *None

NewNone for marshaller.

func (*None) Marshal added in v1.188.0

func (*None) Marshal(_ any) ([]byte, error)

func (*None) Unmarshal added in v1.188.0

func (*None) Unmarshal(_ []byte, _ any) error

type Proto added in v1.78.0

type Proto struct{}

Proto for marshaller.

func NewProto

func NewProto() *Proto

NewProto for marshaller.

func (*Proto) Marshal added in v1.78.0

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

func (*Proto) Unmarshal added in v1.78.0

func (m *Proto) Unmarshal(data []byte, v any) error

type TOML added in v1.80.0

type TOML struct{}

TOML for marshaller.

func NewTOML added in v1.80.0

func NewTOML() *TOML

NewTOML for marshaller.

func (*TOML) Marshal added in v1.80.0

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

func (*TOML) Unmarshal added in v1.80.0

func (m *TOML) Unmarshal(data []byte, v any) error

type YAML added in v1.78.0

type YAML struct{}

YAML for marshaller.

func NewYAML added in v1.78.0

func NewYAML() *YAML

NewYAML for marshaller.

func (*YAML) Marshal added in v1.78.0

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

func (*YAML) Unmarshal added in v1.78.0

func (m *YAML) Unmarshal(data []byte, v any) error

Jump to

Keyboard shortcuts

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