codec

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any added in v0.15.0

type Any = Codec[any]

type Codec

type Codec[T any] interface {
	Marshaler[T]

	NewDecoder(io.Reader) Decoder[T]
	NewEncoder(io.Writer) Encoder[T]
}

func Cast added in v0.15.0

func Cast[T any, C Codec[any]](c C) Codec[T]

type Decoder

type Decoder[T any] interface {
	Decode(v T) error
}

type Encoder

type Encoder[T any] interface {
	Encode(v T) error
}

type Marshaler

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

Jump to

Keyboard shortcuts

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