Versions in this module Expand all Collapse all v1 v1.4.1 May 3, 2026 Changes in this version + const ResponseWireVersion + var ErrInvalidWireFormat = errors.New("store: invalid response wire format") + var ErrNotFound = errors.New("store: key not found") + func DecodeJSON(data []byte, v any) error + func EncodeJSON(v any) ([]byte, error) + type EncodedResponse struct + Body []byte + Headers [][2]string + Status int + func DecodeResponse(buf []byte) (EncodedResponse, error) + func (r EncodedResponse) AppendTo(dst []byte) []byte + func (r EncodedResponse) Encode() []byte + type GetAndDeleter interface + GetAndDelete func(ctx context.Context, key string) ([]byte, error) + type KV interface + Delete func(ctx context.Context, key string) error + Get func(ctx context.Context, key string) ([]byte, error) + Set func(ctx context.Context, key string, value []byte, ttl time.Duration) error + func Prefixed(inner KV, prefix string) KV + type MemoryKV struct + func NewMemoryKV(config ...MemoryKVConfig) *MemoryKV + func (m *MemoryKV) Close() + func (m *MemoryKV) Delete(_ context.Context, key string) error + func (m *MemoryKV) DeletePrefix(_ context.Context, prefix string) error + func (m *MemoryKV) Get(_ context.Context, key string) ([]byte, error) + func (m *MemoryKV) GetAndDelete(_ context.Context, key string) ([]byte, error) + func (m *MemoryKV) Scan(_ context.Context, prefix string) ([]string, error) + func (m *MemoryKV) Set(_ context.Context, key string, value []byte, ttl time.Duration) error + func (m *MemoryKV) SetNX(_ context.Context, key string, value []byte, ttl time.Duration) (bool, error) + type MemoryKVConfig struct + CleanupContext context.Context + CleanupInterval time.Duration + Shards int + type PrefixDeleter interface + DeletePrefix func(ctx context.Context, prefix string) error + type Scanner interface + Scan func(ctx context.Context, prefix string) ([]string, error) + type Scripter interface + EvalSHA func(ctx context.Context, sha string, keys []string, args ...any) (any, error) + ScriptLoad func(ctx context.Context, script string) (string, error) + type SetNXer interface + SetNX func(ctx context.Context, key string, value []byte, ttl time.Duration) (acquired bool, err error)