codec

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidType = errors.New("invalid type for codec operation")
	ErrNilPointer  = errors.New("nil pointer cannot be marshaled")
)

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Encoder
	Decoder
}

func JsonCodec

func JsonCodec() Codec

func StringCodec

func StringCodec() Codec

type Decoder

type Decoder interface {
	Unmarshal(data []byte, val any) error
}

type DecoderFunc

type DecoderFunc func(data []byte, val any) error

func (DecoderFunc) Unmarshal

func (d DecoderFunc) Unmarshal(data []byte, val any) error

type Encoder

type Encoder interface {
	Marshal(val any) ([]byte, error)
}

type EncoderFunc

type EncoderFunc func(val any) ([]byte, error)

func (EncoderFunc) Marshal

func (e EncoderFunc) Marshal(val any) ([]byte, error)

Jump to

Keyboard shortcuts

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