Documentation ¶
Index ¶
- type Client
- func (pool *Client) Del(key ...interface{}) (num int, err error)
- func (pool *Client) EXISTS(key string) (ok bool, err error)
- func (pool *Client) EXPIRE(key string, expireTime int) (num int, err error)
- func (pool *Client) EXPIREAT(key string, expireAtTime int64) (num int, err error)
- func (pool *Client) GETBIT(key string, bit int) (ret int, err error)
- func (pool *Client) Get(key string) (s string, err error)
- func (pool *Client) GetInt(key string) (n int, err error)
- func (pool *Client) GetInt64(key string) (n int64, err error)
- func (pool *Client) GetSearchKeys(key string, limit int) (list []string, err error)
- func (pool *Client) GetSearchKeys2(key string, start, len int) (list []string, err error)
- func (pool *Client) GetSet(key string, value interface{}) (s string, err error)
- func (pool *Client) HEXISTS(key, field string) (ok bool, err error)
- func (pool *Client) HGET(key, field string) (out string, err error)
- func (pool *Client) HGETALLMAP(key string) (interface{}, error)
- func (pool *Client) HINCRBY(key, field string, in int) (num int, err error)
- func (pool *Client) HKEYS(key string) (data []string, err error)
- func (pool *Client) HLEN(key string) (num int, err error)
- func (pool *Client) HMGET(key, feild string) (data []string, err error)
- func (pool *Client) HMGET2(key string, feild ...string) (data []string, err error)
- func (pool *Client) HMGETINT64MAP(key string) (map[string]int64, error)
- func (pool *Client) HMGETINTMAP(key string) (map[string]int, error)
- func (pool *Client) HMGETMAP(key string) (map[string]string, error)
- func (pool *Client) HMGETSTRUCT(key, value interface{}) (err error)
- func (pool *Client) HMSET(key, value interface{}) (ok string, err error)
- func (pool *Client) HMSETArgs(key string, node interface{}) error
- func (pool *Client) HSET(key, field string, value interface{}) (ok bool, err error)
- func (pool *Client) INCR(key string) (err error)
- func (pool *Client) INCRRET(key string) (num int, err error)
- func (pool *Client) KEYS(pattern string) (keys []string, err error)
- func (pool *Client) LINDEX(key string, index int) (out string, err error)
- func (pool *Client) LPOP(key string) (out string, err error)
- func (pool *Client) LPUSH(key string, value ...interface{}) (num int, err error)
- func (pool *Client) Lock(key string, timeout int) (locked bool, expiredTime int64, err error)
- func (pool *Client) LockMust(key string, timeout int) (locked bool, expiredTime int64, err error)
- func (pool *Client) LockRetry(key string, timeout, retryTimes int) (locked bool, expiredTime int64, err error)
- func (pool *Client) SADD(key string, value interface{}) (num int, err error)
- func (pool *Client) SCARD(key string) (num int, err error)
- func (pool *Client) SETBIT(key string, bit, value int) (ret int, err error)
- func (pool *Client) SETEX(key string, seconds int, value interface{}) (err error)
- func (pool *Client) SISMEMBER(key string, value interface{}) (ok bool, err error)
- func (pool *Client) SMEMBERS(key string) (reply []string, err error)
- func (pool *Client) SPOP(key string) (out string, err error)
- func (pool *Client) SREM(key string, value interface{}) (num int, err error)
- func (pool *Client) Set(key string, value interface{}) (err error)
- func (pool *Client) SetNX(key string, value interface{}) (err error)
- func (pool *Client) SetNX2(key string, value interface{}) (num int, err error)
- func (pool *Client) TTL(key string) (ttl int, err error)
- func (pool *Client) UnLock(key string, safeDelTime int64) (bool, error)
- func (pool *Client) Unlink(key ...interface{}) (num int, err error)
- func (pool *Client) ZADD(key string, sorce int, member string) (num int, err error)
- func (pool *Client) ZCARD(key string) (num int, err error)
- func (pool *Client) ZFADD(key string, sorce float64, member string) (num int, err error)
- func (pool *Client) ZFSCORE(key string, member string) (num float64, err error)
- func (pool *Client) ZINCRBY(key string, increment int, member string) (num int, err error)
- func (pool *Client) ZRANGE(key string, start, stop int) (list []string, err error)
- func (pool *Client) ZRANK(key string, member string) (num int, err error)
- func (pool *Client) ZREM(key string, member string) (num int, err error)
- func (pool *Client) ZREMRANGEBYRANK(key string, stop int) (num int, err error)
- func (pool *Client) ZREVRANGE(key string, start, stop int) (list []string, err error)
- func (pool *Client) ZREVRANGEBYSCORE(key string, limit int) (list map[string]string, err error)
- func (pool *Client) ZREVRANGEBYSCORE2(key string, start, len int) (list map[string]int, err error)
- func (pool *Client) ZREVRANGEBYSCORE3(key string, start, len int) (list map[string]float64, err error)
- func (pool *Client) ZREVRANK(key string, member string) (num int, err error)
- func (pool *Client) ZSCORE(key string, member string) (num int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client redis client
func (*Client) GetSearchKeys ¶
GetSearchKeys ZREVRANGEBYSCORE 逆序份数 获取的 前N个数据 不要scores
func (*Client) GetSearchKeys2 ¶
GetSearchKeys2 ZREVRANGEBYSCORE 逆序份数 获取的 start,len 不要scores
func (*Client) HGETALLMAP ¶
HGETALLMAP 返回hash表中所有字段
func (*Client) HMGET ¶
HMGET 返回哈希表 key 中,一个或多个给定域的值。 如果给定的域不存在于哈希表,那么返回一个 nil 值。 因为不存在的 key 被当作一个空哈希表来处理,所以对一个不存在的 key 进行 HMGET 操作将返回一个只带有 nil 值的表。
func (*Client) HMGET2 ¶
HMGET2 返回哈希表 key 中,一个或多个给定域的值。 如果给定的域不存在于哈希表,那么返回一个 nil 值。 因为不存在的 key 被当作一个空哈希表来处理,所以对一个不存在的 key 进行 HMGET 操作将返回一个只带有 nil 值的表。
func (*Client) HMGETINT64MAP ¶
HMGETINT64MAP 返回hash表中所有字段 并映射为map[string]int64
func (*Client) HMGETINTMAP ¶
HMGETINTMAP 返回hash表中所有字段 并映射为map[string]int
func (*Client) HMGETSTRUCT ¶
HMGETSTRUCT 返回hash表中所有字段 并映射为结构体
func (*Client) HMSET ¶
HMSET 同时将多个 field-value (域-值)对设置到哈希表 key 中。 此命令会覆盖哈希表中已存在的域。 如果 key 不存在,一个空哈希表被创建并执行 HMSET 操作。
func (*Client) INCR ¶
INCR 为键 key 储存的数字值加上一。 如果键 key 不存在, 那么它的值会先被初始化为 0 , 然后再执行 INCR 命令。 如果键 key 储存的值不能被解释为数字, 那么 INCR 命令将返回一个错误。 本操作的值限制在 64 位(bit)有符号数字表示之内。
func (*Client) INCRRET ¶
INCRRET INCR 为键 key 储存的数字值加上一。 如果键 key 不存在, 那么它的值会先被初始化为 0 , 然后再执行 INCR 命令。 如果键 key 储存的值不能被解释为数字, 那么 INCR 命令将返回一个错误。 本操作的值限制在 64 位(bit)有符号数字表示之内。
func (*Client) LockRetry ¶
func (pool *Client) LockRetry(key string, timeout, retryTimes int) (locked bool, expiredTime int64, err error)
LockRetry redis 实现的分布式锁 lock retry
func (*Client) SETBIT ¶
SETBIT 对 key 所储存的字符串值,设置或清除指定偏移量上的位(bit)。 位的设置或清除取决于 value 参数,可以是 0 也可以是 1 。 当 key 不存在时,自动生成一个新的字符串值。 字符串会进行伸展(grown)以确保它可以将 value 保存在指定的偏移量上。当字符串值进行伸展时,空白位置以 0 填充。
func (*Client) ZADD ¶
ZADD 将一个或多个 member 元素及其 score 值加入到有序集 key 当中。 如果某个 member 已经是有序集的成员,那么更新这个 member 的 score 值,并通过重新插入这个 member 元素,来保证该 member 在正确的位置上。
func (*Client) ZREMRANGEBYRANK ¶
ZREMRANGEBYRANK myzset 0 1 0 -200(保留200名)
func (*Client) ZREVRANGEBYSCORE ¶
ZREVRANGEBYSCORE 逆序份数 获取的 前N个数据
func (*Client) ZREVRANGEBYSCORE2 ¶
ZREVRANGEBYSCORE2 ZREVRANGEBYSCORE 逆序份数 获取start len的数据
func (*Client) ZREVRANGEBYSCORE3 ¶
func (pool *Client) ZREVRANGEBYSCORE3(key string, start, len int) (list map[string]float64, err error)
ZREVRANGEBYSCORE3 ZREVRANGEBYSCORE 逆序份数 获取start len的数据