codec

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package codec provides a model and conventions for marshaling and unmarshaling values to and from their encodings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	NewDecoder(io.Reader, ...DecodeOption) Decoder
	NewEncoder(io.Writer, ...EncodeOption) Encoder
	Marshal(v any) ([]byte, error)
	Unmarshal(data []byte, v any) error
}

func NewJSONCodec

func NewJSONCodec() Codec

type DecodeOption

type DecodeOption interface {
	Apply(Decoder)
}

type Decoder

type Decoder interface {
	Decode(v any) error
}

type EncodeOption

type EncodeOption interface {
	Apply(Encoder)
}

type Encoder

type Encoder interface {
	Encode(v any) error
}

Jump to

Keyboard shortcuts

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