marshaller

package
v1.124.14 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidKind = errors.New("invalid kind")

ErrInvalidKind for marshaller.

Module for fx.

Functions

This section is empty.

Types

type Factory added in v1.79.0

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

Factory of marshaller.

func NewFactory added in v1.79.0

func NewFactory(params FactoryParams) *Factory

NewFactory for marshaller.

func (*Factory) Create added in v1.79.0

func (f *Factory) Create(kind string) (Marshaller, error)

Create from kind.

type FactoryParams added in v1.79.0

type FactoryParams struct {
	fx.In

	YAML *YAML
	TOML *TOML
}

FactoryParams for marshaller.

type Marshaller

type Marshaller interface {
	Marshal(v any) ([]byte, error)
	Unmarshal(data []byte, v any) error
}

Compressor allows to have different ways to marshal/unmarshal.

type MsgPack added in v1.78.0

type MsgPack struct{}

MsgPack for marshaller.

func NewMsgPack

func NewMsgPack() *MsgPack

NewMsgPack for marshaller.

func (*MsgPack) Marshal added in v1.78.0

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

func (*MsgPack) Unmarshal added in v1.78.0

func (m *MsgPack) Unmarshal(data []byte, v 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