Documentation
¶
Index ¶
- func NewForwardCodec[V any]() trcache.Codec[V]
- func NewFuncCodec[V any](marshal func(ctx context.Context, data V) (any, error), ...) trcache.Codec[V]
- func NewGOBCodec[V any](options ...GOBCodecOption) trcache.Codec[V]
- func NewJSONCodec[V any](options ...JSONCodecOption) trcache.Codec[V]
- type ForwardCodec
- type FuncCodec
- type GOBCodec
- type GOBCodecOption
- type JSONCodec
- type JSONCodecOption
- type StringKeyCodec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewForwardCodec ¶
func NewFuncCodec ¶
func NewGOBCodec ¶
func NewGOBCodec[V any](options ...GOBCodecOption) trcache.Codec[V]
func NewJSONCodec ¶
func NewJSONCodec[V any](options ...JSONCodecOption) trcache.Codec[V]
Types ¶
type ForwardCodec ¶
type ForwardCodec[V any] struct { }
ForwardCodec is a Codec that returns the same object passed.
type FuncCodec ¶
type FuncCodec[V any] struct { // contains filtered or unexported fields }
FuncCodec is a Codec that uses the passed functions as its methods.
type GOBCodec ¶
type GOBCodec[V any] struct { // contains filtered or unexported fields }
GOBCodec is a Codec that marshals from/to encoding/gob.
type GOBCodecOption ¶
type GOBCodecOption func(*gobCodecOptions)
func WithGOBCodecReturnString ¶
func WithGOBCodecReturnString(returnString bool) GOBCodecOption
type JSONCodec ¶
type JSONCodec[V any] struct { // contains filtered or unexported fields }
JSONCodec is a Codec that marshals from/to JSON.
type JSONCodecOption ¶
type JSONCodecOption func(*jsonCodecOptions)
func WithJSONCodecReturnBytes ¶
func WithJSONCodecReturnBytes(returnBytes bool) JSONCodecOption
type StringKeyCodec ¶
type StringKeyCodec[K comparable] struct { }
StringKeyCodec is a key codec that converts all values to string.
func NewStringKeyCodec ¶
func NewStringKeyCodec[K comparable]() *StringKeyCodec[K]
Click to show internal directories.
Click to hide internal directories.