Documentation ¶
Index ¶
- Constants
- Variables
- func GatherMetrics()
- type Item
- type Redis
- func (r *Redis) DecrBy(ctx context.Context, key string, by int64) (i int64, err error)
- func (r *Redis) Del(ctx context.Context, keys ...string) error
- func (r *Redis) Eval(ctx context.Context, script string, keys []string, argvs ...interface{}) (*redis.EvalReturn, error)
- func (r *Redis) Expire(ctx context.Context, key string, ttl int32) error
- func (r *Redis) Get(ctx context.Context, key string) (item *Item, err error)
- func (r *Redis) IncrBy(ctx context.Context, key string, by int64) (i int64, err error)
- func (r *Redis) MGet(ctx context.Context, keys []string) (items map[string]*Item, err error)
- func (r *Redis) Set(ctx context.Context, item *Item) error
- func (r *Redis) TTL(ctx context.Context, key string) (ttl int32, err error)
- func (r *Redis) ZAdd(ctx context.Context, item *Item) (added int64, err error)
- func (r *Redis) ZCard(ctx context.Context, key string) (card int64, err error)
- func (r *Redis) ZCount(ctx context.Context, key, min, max string) (i int64, err error)
- func (r *Redis) ZIncrBy(ctx context.Context, key, member string, by float64) error
- func (r *Redis) ZRange(ctx context.Context, key string, start, stop int64) (values []*ZSetValue, err error)
- func (r *Redis) ZRank(ctx context.Context, key, member string) (rank int64, err error)
- func (r *Redis) ZRem(ctx context.Context, keys ...string) error
- func (r *Redis) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (i int64, err error)
- func (r *Redis) ZRemRangeByScore(ctx context.Context, key, min, max string) (i int64, err error)
- func (r *Redis) ZRevRange(ctx context.Context, key string, start, stop int64) (values []*ZSetValue, err error)
- func (r *Redis) ZRevRank(ctx context.Context, key, member string) (rank int64, err error)
- func (r *Redis) ZScore(ctx context.Context, key, member string) (score float64, err error)
- type ZSetValue
Constants ¶
View Source
const ( // FlagNX Not Exist FlagNX = redis.FlagNX )
Variables ¶
View Source
var ErrNonExist = redis.Nil
ErrNonExist 查询的 key 不存在或者榜单中 member 不存在
Functions ¶
Types ¶
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis 客户端对象
func (*Redis) Eval ¶
func (r *Redis) Eval(ctx context.Context, script string, keys []string, argvs ...interface{}) (*redis.EvalReturn, error)
Eval 执行lua脚本
func (*Redis) ZRange ¶
func (r *Redis) ZRange(ctx context.Context, key string, start, stop int64) (values []*ZSetValue, err error)
ZRange 返回有序集 key 中,指定区间内的成员 其中成员的位置按 score 值递增(从小到大)来排序 具有相同 score 值的成员按字典序(lexicographical order)来排列
func (*Redis) ZRank ¶
ZRank 返回有序集 key 中成员 member 的排名 其中有序集成员按 score 值递增(从小到大)顺序排列 排名以 0 为底,也就是说, score 值最小的成员排名为 0
func (*Redis) ZRemRangeByRank ¶
func (r *Redis) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (i int64, err error)
ZRemRangeByRank 移除有序集 key 中,指定排名(rank)区间内的所有成员 移除排名在 [start, stop] 区间的成员,返回被移除的成员的数量
func (*Redis) ZRemRangeByScore ¶
ZRemRangeByScore 移除有序集 key 中,所有 score 值介于 min 和 max 之间(包括等于 min 或 max)的成员
func (*Redis) ZRevRange ¶
func (r *Redis) ZRevRange(ctx context.Context, key string, start, stop int64) (values []*ZSetValue, err error)
ZRevRange 返回有序集 key 中,指定区间内的成员 其中成员的位置按 score 值递减(从大到小)来排列 具有相同 score 值的成员按字典序的逆序(reverse lexicographical order)排列。
Click to show internal directories.
Click to hide internal directories.