encodingx

package
v0.0.0-...-9580147 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenericUnmarshal

func GenericUnmarshal[V any](data []byte, unmarshal func(data []byte, v any) error) (V, error)

func RegisterDecoderFactory

func RegisterDecoderFactory(name string, factory DecoderFactory)

func RegisterEncoderFactory

func RegisterEncoderFactory(name string, factory EncoderFactory)

Types

type Decoder

type Decoder interface {
	Decode(obj any) error
}

type DecoderFactory

type DecoderFactory func(r io.Reader) Decoder

func GetDecoderFactory

func GetDecoderFactory(name string) DecoderFactory

type Encoder

type Encoder interface {
	Encode(val any) error
}

type EncoderFactory

type EncoderFactory func(w io.Writer) Encoder

func GetEncoderFactory

func GetEncoderFactory(name string) EncoderFactory

type JSONEncoder

type JSONEncoder interface {
	Encoder
	SetIndent(prefix, indent string)
	SetEscapeHTML(escapeHTML bool)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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