kvs

package
v0.0.0-...-6f95374 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory[T any] interface {
	KVS(string, *redis.Client) (*KVS[T], error)
}

type KVS

type KVS[T any] struct {
	Prefix string
	Client *redis.Client
}

func (*KVS[T]) CreateTxDelCmd

func (kvs *KVS[T]) CreateTxDelCmd(_ context.Context, key string) (cache.TxDelCmd, error)

func (*KVS[T]) CreateTxSetCmd

func (kvs *KVS[T]) CreateTxSetCmd(_ context.Context, key string, value T, ttl time.Duration) (cache.TxSetCmd, error)

func (*KVS[T]) Del

func (kvs *KVS[T]) Del(ctx context.Context, key string) error

func (*KVS[T]) Get

func (kvs *KVS[T]) Get(ctx context.Context, key string) (T, error)

func (*KVS[T]) GetDel

func (kvs *KVS[T]) GetDel(ctx context.Context, key string) (T, error)

func (*KVS[T]) Keys

func (kvs *KVS[T]) Keys(
	ctx context.Context,
	pattern string,
	prefix cache.Prefix,
) ([]string, error)

func (*KVS[T]) Set

func (kvs *KVS[T]) Set(ctx context.Context, key string, value T, ttl time.Duration) error

func (*KVS[T]) Tx

func (kvs *KVS[T]) Tx(
	ctx context.Context,
	sets []cache.TxSetCmd,
	dels []cache.TxDelCmd,
) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL