Help us shape the future of Go! Take the 2026 Go Developer Survey

codec

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec[T any, PT *T] interface {
	MarshalBinary(v PT) ([]byte, error)
	UnmarshalBinary(data []byte) (PT, error)
}

type FileCodec added in v0.6.0

type FileCodec[T any, PT *T] interface {
	MarshalFile(path string, v PT) error
	UnmarshalFile(path string) (PT, error)
}

type JsonCodec added in v0.6.0

type JsonCodec[T any, PT *T] struct {
}

func (JsonCodec[T, PT]) MarshalBinary added in v0.6.0

func (codec JsonCodec[T, PT]) MarshalBinary(v PT) ([]byte, error)

func (JsonCodec[T, PT]) MarshalFile added in v0.6.0

func (codec JsonCodec[T, PT]) MarshalFile(path string, v PT) error

func (JsonCodec[T, PT]) UnmarshalBinary added in v0.6.0

func (codec JsonCodec[T, PT]) UnmarshalBinary(data []byte) (PT, error)

func (JsonCodec[T, PT]) UnmarshalFile added in v0.6.0

func (codec JsonCodec[T, PT]) UnmarshalFile(path string) (PT, error)

type ProtoCodec

type ProtoCodec[T any, PT interface {
	*T
	proto.Message
}] struct {
}

func (ProtoCodec[T, PT]) MarshalBinary

func (codec ProtoCodec[T, PT]) MarshalBinary(v PT) ([]byte, error)

func (ProtoCodec[T, PT]) MarshalFile added in v0.6.0

func (codec ProtoCodec[T, PT]) MarshalFile(path string, v PT) error

func (ProtoCodec[T, PT]) UnmarshalBinary

func (codec ProtoCodec[T, PT]) UnmarshalBinary(data []byte) (PT, error)

func (ProtoCodec[T, PT]) UnmarshalFile added in v0.6.0

func (codec ProtoCodec[T, PT]) UnmarshalFile(path string) (PT, error)

type ProtoJsonCodec

type ProtoJsonCodec[T any, PT interface {
	*T
	proto.Message
}] struct {
}

func (ProtoJsonCodec[T, PT]) MarshalBinary

func (codec ProtoJsonCodec[T, PT]) MarshalBinary(v PT) ([]byte, error)

func (ProtoJsonCodec[T, PT]) MarshalFile added in v0.6.0

func (codec ProtoJsonCodec[T, PT]) MarshalFile(path string, v PT) error

func (ProtoJsonCodec[T, PT]) UnmarshalBinary

func (codec ProtoJsonCodec[T, PT]) UnmarshalBinary(data []byte) (PT, error)

func (ProtoJsonCodec[T, PT]) UnmarshalFile added in v0.6.0

func (codec ProtoJsonCodec[T, PT]) UnmarshalFile(path string) (PT, error)

type YamlCodec added in v0.6.0

type YamlCodec[T any, PT *T] struct {
}

func (YamlCodec[T, PT]) MarshalBinary added in v0.6.0

func (codec YamlCodec[T, PT]) MarshalBinary(v PT) ([]byte, error)

func (YamlCodec[T, PT]) MarshalFile added in v0.6.0

func (codec YamlCodec[T, PT]) MarshalFile(path string, v PT) error

func (YamlCodec[T, PT]) UnmarshalBinary added in v0.6.0

func (codec YamlCodec[T, PT]) UnmarshalBinary(data []byte) (PT, error)

func (YamlCodec[T, PT]) UnmarshalFile added in v0.6.0

func (codec YamlCodec[T, PT]) UnmarshalFile(path string) (PT, error)

Jump to

Keyboard shortcuts

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