privateencoding

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedType = errors.New("unsupported type")

Functions

func Register added in v0.0.3

func Register[T any]()

Register records a type name mapping used for interface serialization. Types serialized behind interface fields must be registered before decode.

func RegisterType added in v0.0.13

func RegisterType(rt reflect.Type)

Types

type Decoder

type Decoder[T any] struct {
	// contains filtered or unexported fields
}

Decoder is used to deserialize values of type T from a binary format, it deserializes exported AND unexported fields of the type T.

func NewDecoder

func NewDecoder[T any](r io.Reader) *Decoder[T]

func (*Decoder[T]) Decode

func (d *Decoder[T]) Decode() (T, error)

type Encoder

type Encoder[T any] struct {
	// contains filtered or unexported fields
}

Encoder is used to serialize values of type T to a binary format, it serializes exported AND unexported fields of the type T.

func NewEncoder

func NewEncoder[T any](w io.Writer) *Encoder[T]

func (*Encoder[T]) Encode

func (e *Encoder[T]) Encode(data T) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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