codec
v1.21.5
github.com/luxfi/database/codec
Documentation
pkg.go.dev ↗Types
Codec
type Codec interface {
MarshalInto(source interface{}, destination []byte) error
Unmarshal(source []byte, destination interface{}) error
Size(value interface{}) (int, error)
}
Codec defines the interface for encoding/decoding
Manager
type Manager interface {
Marshal(version uint16, source interface{}) ([]byte, error)
Unmarshal(source []byte, destination interface{}) (uint16, error)
RegisterCodec(version uint16, codec Codec) error
Size(version uint16, source interface{}) (int, error)
}
Manager defines the interface for codec management