encoding

package
v1.424.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

This section is empty.

Types

type Encoder added in v1.282.0

type Encoder interface {
	// Encode any to a writer.
	Encode(w io.Writer, e any) error

	// Decode any from a reader.
	Decode(r io.Reader, e any) error
}

Encoder allows different types of encoding/decoding.

type Map

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

Map of encoding.

func NewMap

func NewMap(params MapParams) *Map

NewMap for encoding.

func (*Map) Get

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

Get from kind.

func (*Map) Register

func (f *Map) Register(kind string, enc Encoder)

Register kind and encoder.

type MapParams added in v1.420.0

type MapParams struct {
	fx.In

	JSON        *json.Encoder
	YAML        *yaml.Encoder
	TOML        *toml.Encoder
	ProtoBinary *proto.Binary
	ProtoText   *proto.Text
	ProtoJSON   *proto.JSON
	GOB         *gob.Encoder
}

MapParams for encoding.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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