Documentation
¶
Overview ¶
Package codec provides serialization codecs for KV values.
Codecs handle the marshalling and unmarshalling of Go types to and from byte slices for storage in KV backends. The default codec is JSON.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface {
// Encode serializes v into bytes.
Encode(v any) ([]byte, error)
// Decode deserializes data into v. v must be a pointer.
Decode(data []byte, v any) error
// Name returns the codec identifier (e.g., "json", "msgpack", "protobuf").
Name() string
}
Codec serializes and deserializes values for KV storage.
type Gob ¶
type Gob struct{}
Gob implements Codec using Go's gob encoding. Types must be registered with gob.Register if they are interface values.
Click to show internal directories.
Click to hide internal directories.