serialization

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoProtobufPayload     = errors.New("payload is not protobuf serializable")
	ErrNoProtobufDestination = errors.New("destination is not protobuf deserializable")
)

Functions

This section is empty.

Types

type JSON

type JSON struct{}

func NewJSONSerializer

func NewJSONSerializer() *JSON

func (*JSON) Deserialize

func (p *JSON) Deserialize(input []byte, dst interface{}) error

func (*JSON) Serialize

func (p *JSON) Serialize(input interface{}) ([]byte, error)

type ProtoJSON

type ProtoJSON struct{}

func NewProtoJSONSerializer

func NewProtoJSONSerializer() *ProtoJSON

func (*ProtoJSON) Deserialize

func (p *ProtoJSON) Deserialize(input []byte, dst interface{}) error

func (*ProtoJSON) Serialize

func (p *ProtoJSON) Serialize(input interface{}) ([]byte, error)

type Protobuf

type Protobuf struct{}

func NewProtobufSerializer

func NewProtobufSerializer() *Protobuf

func (*Protobuf) Deserialize

func (p *Protobuf) Deserialize(input []byte, dst interface{}) error

func (*Protobuf) Serialize

func (p *Protobuf) Serialize(input interface{}) ([]byte, error)

type Serializer

type Serializer interface {
	Serialize(input interface{}) ([]byte, error)
	Deserialize(input []byte, dst interface{}) error
}

Jump to

Keyboard shortcuts

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