Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BytesCodec ¶
type BytesCodec struct{}
type CBORCodec ¶
type CBORCodec[V any] struct { // contains filtered or unexported fields }
func MustCBORCodec ¶
MustCBORCodec is a convenience helper that panics on construction error.
func NewCBORCodec ¶
NewCBORCodec creates a CBOR codec. * if deterministic == true, it uses Core Deterministic Encoding (RFC 8949). * Otherwise, it uses PreferredUnsortedEncOptions (sensible defaults). Also sets time encoding to RFC3339Nano.
type LimitCodec ¶
type LimitCodec[V any] struct { Inner interface { Encode(V) ([]byte, error) Decode([]byte) (V, error) } MaxDecode int // bytes }
func (LimitCodec[V]) Decode ¶
func (c LimitCodec[V]) Decode(b []byte) (V, error)
func (LimitCodec[V]) Encode ¶
func (c LimitCodec[V]) Encode(v V) ([]byte, error)
type MsgpackCodec ¶
type MsgpackCodec[V any] struct{}
func (MsgpackCodec[V]) Decode ¶
func (MsgpackCodec[V]) Decode(b []byte) (V, error)
func (MsgpackCodec[V]) Encode ¶
func (MsgpackCodec[V]) Encode(v V) ([]byte, error)
type ProtobufCodec ¶
func NewProtobufCodec ¶
func NewProtobufCodec[T proto.Message](ctor func() T) ProtobufCodec[T]
func (ProtobufCodec[T]) Decode ¶
func (c ProtobufCodec[T]) Decode(b []byte) (T, error)
func (ProtobufCodec[T]) Encode ¶
func (c ProtobufCodec[T]) Encode(v T) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.