Versions in this module Expand all Collapse all v0 v0.15.0 Oct 16, 2023 Changes in this version + func NewForwardCodec() trcache.Codec[V] + func NewFuncCodec(marshal func(ctx context.Context, data V) (any, error), ...) trcache.Codec[V] + func NewGOBCodec(options ...GOBCodecOption) trcache.Codec[V] + func NewJSONCodec(options ...JSONCodecOption) trcache.Codec[V] + type ForwardCodec struct + func (c ForwardCodec[V]) Decode(ctx context.Context, data any) (V, error) + func (c ForwardCodec[V]) Encode(ctx context.Context, data V) (any, error) + type FuncCodec struct + func (c FuncCodec[V]) Decode(ctx context.Context, data any) (V, error) + func (c FuncCodec[V]) Encode(ctx context.Context, data V) (any, error) + type GOBCodec struct + func (c GOBCodec[V]) Decode(ctx context.Context, data any) (V, error) + func (c GOBCodec[V]) Encode(ctx context.Context, data V) (any, error) + type GOBCodecOption func(*gobCodecOptions) + func WithGOBCodecReturnString(returnString bool) GOBCodecOption + type JSONCodec struct + func (c JSONCodec[V]) Decode(ctx context.Context, data any) (V, error) + func (c JSONCodec[V]) Encode(ctx context.Context, data V) (any, error) + type JSONCodecOption func(*jsonCodecOptions) + func WithJSONCodecReturnBytes(returnBytes bool) JSONCodecOption + type StringKeyCodec struct + func NewStringKeyCodec() *StringKeyCodec[K] + func (s *StringKeyCodec[K]) Convert(ctx context.Context, key K) (any, error)