serialization

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ISerializer

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

func NewJSONSerializer

func NewJSONSerializer() ISerializer

func NewXmlSerializer

func NewXmlSerializer() ISerializer

func NewYamlSerializer

func NewYamlSerializer() ISerializer

type JsonSerializer

type JsonSerializer struct{}

func (*JsonSerializer) Marshal

func (j *JsonSerializer) Marshal(v any) ([]byte, error)

Marshal implements ISerializer.

func (*JsonSerializer) Unmarshal

func (j *JsonSerializer) Unmarshal(data []byte, v any) error

Unmarshal implements ISerializer.

type XmlSerializer

type XmlSerializer struct{}

func (*XmlSerializer) Marshal

func (j *XmlSerializer) Marshal(v any) ([]byte, error)

Marshal implements ISerializer.

func (*XmlSerializer) Unmarshal

func (j *XmlSerializer) Unmarshal(data []byte, v any) error

Unmarshal implements ISerializer.

type YamlSerializer

type YamlSerializer struct{}

func (*YamlSerializer) Marshal

func (j *YamlSerializer) Marshal(v any) ([]byte, error)

Marshal implements ISerializer.

func (*YamlSerializer) Unmarshal

func (j *YamlSerializer) Unmarshal(data []byte, v any) error

Unmarshal implements ISerializer.

Jump to

Keyboard shortcuts

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