kv

package
v0.0.0-...-d5d5ef8 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 8 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) (int64, error)
	DelCtx(ctx context.Context, keys ...string) (int64, error)
	Eval(script string, keys []string, args ...any) (any, error)
	EvalCtx(ctx context.Context, script string, keys []string, args ...any) (any, error)
	Exists(key string) (bool, error)
	ExistsCtx(ctx context.Context, key string) (bool, error)
	Expire(key string, expire time.Duration) error
	ExpireCtx(ctx context.Context, key string, expire time.Duration) 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 string, value interface{}) (string, error)
	GetSetCtx(ctx context.Context, key string, value interface{}) (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) (int64, error)
	HincrbyCtx(ctx context.Context, key, field string, increment int) (int64, error)
	Hkeys(key string) ([]string, error)
	HkeysCtx(ctx context.Context, key string) ([]string, error)
	Hlen(key string) (int64, error)
	HlenCtx(ctx context.Context, key string) (int64, error)
	Hmget(key string, fields ...string) ([]string, error)
	HmgetCtx(ctx context.Context, key string, fields ...string) ([]string, error)
	Hset(key, field string, value interface{}) error
	HsetCtx(ctx context.Context, key, field string, value interface{}) error
	Hsetnx(key, field string, value interface{}) (bool, error)
	HsetnxCtx(ctx context.Context, key, field string, value interface{}) (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) (int64, error)
	LlenCtx(ctx context.Context, key string) (int64, error)
	Lpop(key string) (string, error)
	LpopCtx(ctx context.Context, key string) (string, error)
	Lpush(key string, values ...any) (int64, error)
	LpushCtx(ctx context.Context, key string, values ...any) (int64, 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 interface{}) (int64, error)
	LremCtx(ctx context.Context, key string, count int, value interface{}) (int64, 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) (int64, error)
	RpushCtx(ctx context.Context, key string, values ...any) (int64, error)
	Sadd(key string, values ...any) (int64, error)
	SaddCtx(ctx context.Context, key string, values ...any) (int64, error)
	Scard(key string) (int64, error)
	ScardCtx(ctx context.Context, key string) (int64, error)
	Set(key string, value interface{}) error
	SetCtx(ctx context.Context, key string, value interface{}) error
	Setex(key string, value interface{}, seconds int) error
	SetexCtx(ctx context.Context, key string, value interface{}, seconds int) error
	Setnx(key string, value interface{}) (bool, error)
	SetnxCtx(ctx context.Context, key string, value interface{}) (bool, error)
	SetnxEx(key string, value interface{}, seconds int) (bool, error)
	SetnxExCtx(ctx context.Context, key string, value interface{}, 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) (int64, error)
	SremCtx(ctx context.Context, key string, values ...any) (int64, 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) (time.Duration, error)
	TtlCtx(ctx context.Context, key string) (time.Duration, error)
	Zadd(key string, score int64, value interface{}) (bool, error)
	ZaddFloat(key string, score float64, value interface{}) (bool, error)
	ZaddCtx(ctx context.Context, key string, score int64, value interface{}) (bool, error)
	ZaddFloatCtx(ctx context.Context, key string, score float64, value interface{}) (bool, error)
	Zadds(key string, ps ...redis.Pair) (int64, error)
	ZaddsCtx(ctx context.Context, key string, ps ...redis.Pair) (int64, error)
	Zcard(key string) (int64, error)
	ZcardCtx(ctx context.Context, key string) (int64, error)
	Zcount(key string, start, stop int64) (int64, error)
	ZcountCtx(ctx context.Context, key string, start, stop int64) (int64, 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) (int64, error)
	ZremCtx(ctx context.Context, key string, values ...any) (int64, error)
	Zremrangebyrank(key string, start, stop int64) (int64, error)
	ZremrangebyrankCtx(ctx context.Context, key string, start, stop int64) (int64, error)
	Zremrangebyscore(key string, start, stop int64) (int64, error)
	ZremrangebyscoreCtx(ctx context.Context, key string, start, stop int64) (int64, 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)
	Redis(key string) (*redis.Redis, 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