encoding

package
v1.259.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 6 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

This section is empty.

Types

type Map

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

Map of marshaller.

func NewMap

func NewMap() *Map

NewMap for marshaller.

func (*Map) Get

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

Get from kind.

func (*Map) Register

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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