kv

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRedisNode = errors.New("no redis node")

ErrNoRedisNode is an error that indicates no redis node.

Functions

This section is empty.

Types

type KvConf

type KvConf = cache.ClusterConf

KvConf is an alias of cache.ClusterConf.

type Store

type Store interface {
	Decr(key string) (int64, error)
	DecrCtx(ctx context.Context, key string) (int64, error)
	Decrby(key string, decrement int64) (int64, error)
	DecrbyCtx(ctx context.Context, key string, decrement int64) (int64, error)
	Del(keys ...string) (int, error)
	DelCtx(ctx context.Context, keys ...string) (int, error)
	Eval(script, key string, args ...any) (any, error)
	EvalCtx(ctx context.Context, script, key string, args ...any) (any, error)
	Exists(key string) (bool, error)
	ExistsCtx(ctx context.Context, key string) (bool, error)
	Expire(key string, seconds int) error
	ExpireCtx(ctx context.Context, key string, seconds int) error
	Expireat(key string, expireTime int64) error
	ExpireatCtx(ctx context.Context, key string, expireTime int64) error
	Get(key string) (string, error)
	GetCtx(ctx context.Context, key string) (string, error)
	GetSet(key, value string) (string, error)
	GetSetCtx(ctx context.Context, key, value string) (string, error)
	Hdel(key, field string) (bool, error)
	HdelCtx(ctx context.Context, key, field string) (bool, error)
	Hexists(key, field string) (bool, error)
	HexistsCtx(ctx context.Context, key, field string) (bool, error)
	Hget(key, field string) (string, error)
	HgetCtx(ctx context.Context, key, field string) (string, error)
	Hgetall(key string) (map[string]string, error)
	HgetallCtx(ctx context.Context, key string) (map[string]string, error)
	Hincrby(key, field string, increment int) (int, error)
	HincrbyCtx(ctx context.Context, key, field string, increment int) (int, error)
	Hkeys(key string) ([]string, error)
	HkeysCtx(ctx context.Context, key string) ([]string, error)
	Hlen(key string) (int, error)
	HlenCtx(ctx context.Context, key string) (int, error)
	Hmget(key string, fields ...string) ([]string, error)
	HmgetCtx(ctx context.Context, key string, fields ...string) ([]string, error)
	Hset(key, field, value string) error
	HsetCtx(ctx context.Context, key, field, value string) error
	Hsetnx(key, field, value string) (bool, error)
	HsetnxCtx(ctx context.Context, key, field, value string) (bool, error)
	Hmset(key string, fieldsAndValues map[string]string) error
	HmsetCtx(ctx context.Context, key string, fieldsAndValues map[string]string) error
	Hvals(key string) ([]string, error)
	HvalsCtx(ctx context.Context, key string) ([]string, error)
	Incr(key string) (int64, error)
	IncrCtx(ctx context.Context, key string) (int64, error)
	Incrby(key string, increment int64) (int64, error)
	IncrbyCtx(ctx context.Context, key string, increment int64) (int64, error)
	Lindex(key string, index int64) (string, error)
	LindexCtx(ctx context.Context, key string, index int64) (string, error)
	Llen(key string) (int, error)
	LlenCtx(ctx context.Context, key string) (int, error)
	Lpop(key string) (string, error)
	LpopCtx(ctx context.Context, key string) (string, error)
	Lpush(key string, values ...any) (int, error)
	LpushCtx(ctx context.Context, key string, values ...any) (int, error)
	Lrange(key string, start, stop int) ([]string, error)
	LrangeCtx(ctx context.Context, key string, start, stop int) ([]string, error)
	Lrem(key string, count int, value string) (int, error)
	LremCtx(ctx context.Context, key string, count int, value string) (int, error)
	Persist(key string) (bool, error)
	PersistCtx(ctx context.Context, key string) (bool, error)
	Pfadd(key string, values ...any) (bool, error)
	PfaddCtx(ctx context.Context, key string, values ...any) (bool, error)
	Pfcount(key string) (int64, error)
	PfcountCtx(ctx context.Context, key string) (int64, error)
	Rpush(key string, values ...any) (int, error)
	RpushCtx(ctx context.Context, key string, values ...any) (int, error)
	Sadd(key string, values ...any) (int, error)
	SaddCtx(ctx context.Context, key string, values ...any) (int, error)
	Scard(key string) (int64, error)
	ScardCtx(ctx context.Context, key string) (int64, error)
	Set(key, value string) error
	SetCtx(ctx context.Context, key, value string) error
	Setex(key, value string, seconds int) error
	SetexCtx(ctx context.Context, key, value string, seconds int) error
	Setnx(key, value string) (bool, error)
	SetnxCtx(ctx context.Context, key, value string) (bool, error)
	SetnxEx(key, value string, seconds int) (bool, error)
	SetnxExCtx(ctx context.Context, key, value string, seconds int) (bool, error)
	Sismember(key string, value any) (bool, error)
	SismemberCtx(ctx context.Context, key string, value any) (bool, error)
	Smembers(key string) ([]string, error)
	SmembersCtx(ctx context.Context, key string) ([]string, error)
	Spop(key string) (string, error)
	SpopCtx(ctx context.Context, key string) (string, error)
	Srandmember(key string, count int) ([]string, error)
	SrandmemberCtx(ctx context.Context, key string, count int) ([]string, error)
	Srem(key string, values ...any) (int, error)
	SremCtx(ctx context.Context, key string, values ...any) (int, error)
	Sscan(key string, cursor uint64, match string, count int64) (keys []string, cur uint64, err error)
	SscanCtx(ctx context.Context, key string, cursor uint64, match string, count int64) (keys []string, cur uint64, err error)
	Ttl(key string) (int, error)
	TtlCtx(ctx context.Context, key string) (int, error)
	Zadd(key string, score int64, value string) (bool, error)
	ZaddFloat(key string, score float64, value string) (bool, error)
	ZaddCtx(ctx context.Context, key string, score int64, value string) (bool, error)
	ZaddFloatCtx(ctx context.Context, key string, score float64, value string) (bool, error)
	Zadds(key string, ps ...redis.Pair) (int64, error)
	ZaddsCtx(ctx context.Context, key string, ps ...redis.Pair) (int64, error)
	Zcard(key string) (int, error)
	ZcardCtx(ctx context.Context, key string) (int, error)
	Zcount(key string, start, stop int64) (int, error)
	ZcountCtx(ctx context.Context, key string, start, stop int64) (int, error)
	Zincrby(key string, increment int64, field string) (int64, error)
	ZincrbyCtx(ctx context.Context, key string, increment int64, field string) (int64, error)
	Zrange(key string, start, stop int64) ([]string, error)
	ZrangeCtx(ctx context.Context, key string, start, stop int64) ([]string, error)
	ZrangeWithScores(key string, start, stop int64) ([]redis.Pair, error)
	ZrangeWithScoresCtx(ctx context.Context, key string, start, stop int64) ([]redis.Pair, error)
	ZrangebyscoreWithScores(key string, start, stop int64) ([]redis.Pair, error)
	ZrangebyscoreWithScoresCtx(ctx context.Context, key string, start, stop int64) ([]redis.Pair, error)
	ZrangebyscoreWithScoresAndLimit(key string, start, stop int64, page, size int) ([]redis.Pair, error)
	ZrangebyscoreWithScoresAndLimitCtx(ctx context.Context, key string, start, stop int64, page, size int) ([]redis.Pair, error)
	Zrank(key, field string) (int64, error)
	ZrankCtx(ctx context.Context, key, field string) (int64, error)
	Zrem(key string, values ...any) (int, error)
	ZremCtx(ctx context.Context, key string, values ...any) (int, error)
	Zremrangebyrank(key string, start, stop int64) (int, error)
	ZremrangebyrankCtx(ctx context.Context, key string, start, stop int64) (int, error)
	Zremrangebyscore(key string, start, stop int64) (int, error)
	ZremrangebyscoreCtx(ctx context.Context, key string, start, stop int64) (int, error)
	Zrevrange(key string, start, stop int64) ([]string, error)
	ZrevrangeCtx(ctx context.Context, key string, start, stop int64) ([]string, error)
	ZrevrangebyscoreWithScores(key string, start, stop int64) ([]redis.Pair, error)
	ZrevrangebyscoreWithScoresCtx(ctx context.Context, key string, start, stop int64) ([]redis.Pair, error)
	ZrevrangebyscoreWithScoresAndLimit(key string, start, stop int64, page, size int) ([]redis.Pair, error)
	ZrevrangebyscoreWithScoresAndLimitCtx(ctx context.Context, key string, start, stop int64, page, size int) ([]redis.Pair, error)
	Zscore(key, value string) (int64, error)
	ZscoreCtx(ctx context.Context, key, value string) (int64, error)
	Zrevrank(key, field string) (int64, error)
	ZrevrankCtx(ctx context.Context, key, field string) (int64, error)
}

Store interface represents a KV store.

func NewStore

func NewStore(c KvConf) Store

NewStore returns a Store.

Jump to

Keyboard shortcuts

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