serialize

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisallowUnknownFields

func DisallowUnknownFields() utils.OptionFunc[unmarshalOption]

func JsonEscapeHTML

func JsonEscapeHTML(on bool) utils.OptionFunc[marshalOption]

func JsonIndent

func JsonIndent(prefix, indent string) utils.OptionFunc[marshalOption]

func JsonNumber

func JsonNumber() utils.OptionFunc[unmarshalOption]

func MarshalFunc

func MarshalFunc(algo Algorithm, opts ...utils.OptionExtender) func(src any) ([]byte, error)

func MarshalStreamFunc

func MarshalStreamFunc(algo Algorithm, opts ...utils.OptionExtender) func(dst io.Writer, src any) error

func MsgpackUseCompactFloats

func MsgpackUseCompactFloats(on bool) utils.OptionFunc[marshalOption]

func MsgpackUseCompactInts

func MsgpackUseCompactInts(on bool) utils.OptionFunc[marshalOption]

func UnmarshalFunc

func UnmarshalFunc[T any](algo Algorithm, opts ...utils.OptionExtender) func(src []byte) (T, error)

func UnmarshalFuncByType

func UnmarshalFuncByType(algo Algorithm, dst any, opts ...utils.OptionExtender) func([]byte) (any, error)

func UnmarshalStreamFunc

func UnmarshalStreamFunc[T any](algo Algorithm, opts ...utils.OptionExtender) func(io.Reader) (T, error)

func UnmarshalStreamFuncByType

func UnmarshalStreamFuncByType(algo Algorithm, dst any, opts ...utils.OptionExtender) func(io.Reader) (any, error)

Types

type Algorithm

type Algorithm uint8
const (
	AlgorithmUnknown Algorithm = iota
	AlgorithmGob
	AlgorithmJson
	AlgorithmMsgpack
	AlgorithmCbor
)

func ParseAlgorithm

func ParseAlgorithm(s any) Algorithm

func (Algorithm) IsValid

func (e Algorithm) IsValid() bool

func (Algorithm) String

func (e Algorithm) String() string

func (Algorithm) Value

func (e Algorithm) Value() uint8

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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