Documentation ¶
Index ¶
- func RegisterRedisPool(host, port string, options ...Option)
- func SetDebug(d ...bool)
- type Conf
- type Jredis
- func (j *Jredis) APPEND(key string, value interface{}) int
- func (j *Jredis) BLPOP(timeout int, keys ...string) []string
- func (j *Jredis) BRPOP(timeout int, keys ...string) []string
- func (j *Jredis) BRPOPLPUSH(source, destination string, timeout int) string
- func (j *Jredis) Client() (redis.Conn, error)
- func (j *Jredis) DECR(key string) int
- func (j *Jredis) DECRBY(key string, decrement interface{}) int
- func (j *Jredis) DEL(keys ...string) int
- func (j *Jredis) EXEC(conn redis.Conn, cmd string, args ...interface{}) (interface{}, error)
- func (j *Jredis) EXISTS(key string) int
- func (j *Jredis) EXPIRE(key string, expire int) int
- func (j *Jredis) GET(key string) string
- func (j *Jredis) GETBIT(key string, offset interface{}) int
- func (j *Jredis) GETRANGE(key string, start, end interface{}) string
- func (j *Jredis) GETSET(key string, value interface{}) string
- func (j *Jredis) GetRealKey(key string) string
- func (j *Jredis) HDEL(key string, fields ...interface{}) int
- func (j *Jredis) HEXISTS(key string, field interface{}) int
- func (j *Jredis) HGET(key string, field interface{}) string
- func (j *Jredis) HGETALL(key string) map[string]string
- func (j *Jredis) HINCRBY(key string, field interface{}, increment int) int
- func (j *Jredis) HINCRBYFLOAT(key string, field interface{}, increment float64) float64
- func (j *Jredis) HKEYS(key string) []string
- func (j *Jredis) HLEN(key string) int
- func (j *Jredis) HMGET(key string, fields ...interface{}) []string
- func (j *Jredis) HMSET(key string, mapKv map[interface{}]interface{}) bool
- func (j *Jredis) HSCAN(key string, count int, pattern ...string) map[string]string
- func (j *Jredis) HSET(key string, field, value interface{}) int
- func (j *Jredis) HSETNX(key string, field, value interface{}) int
- func (j *Jredis) HSTRLEN(key string, field interface{}) int
- func (j *Jredis) HVALS(key string) []string
- func (j *Jredis) INCR(key string) int
- func (j *Jredis) INCRBY(key string, decrement interface{}) int
- func (j *Jredis) INCRBYFLOAT(key string, decrement interface{}) float64
- func (j *Jredis) LINDEX(key string, index int) string
- func (j *Jredis) LINSERTAFTER(key string, privot, value interface{}) int
- func (j *Jredis) LINSERTBEFORE(key string, privot, value interface{}) int
- func (j *Jredis) LLEN(key string) int
- func (j *Jredis) LPOP(key string) string
- func (j *Jredis) LPUSH(key string, values ...interface{}) int
- func (j *Jredis) LPUSHX(key string, values ...interface{}) int
- func (j *Jredis) LRANGE(key string, start, stop int) []string
- func (j *Jredis) LREM(key string, count int, value interface{}) int
- func (j *Jredis) LSET(key string, index int, value interface{}) bool
- func (j *Jredis) LTRIM(key string, start, stop int) bool
- func (j *Jredis) MGET(keys ...string) []string
- func (j *Jredis) MSET(mapKv map[string]interface{}) bool
- func (j *Jredis) MSETNX(mapKv map[string]interface{}) int
- func (j *Jredis) RENAME(key, newKey string) bool
- func (j *Jredis) RPOP(key string) string
- func (j *Jredis) RPOPLPUSH(source, destination string) string
- func (j *Jredis) RPUSH(key string, values ...interface{}) int
- func (j *Jredis) RPUSHX(key string, values ...interface{}) int
- func (j *Jredis) SADD(key string, val ...interface{}) int
- func (j *Jredis) SCAN(count int, pattern ...string) []string
- func (j *Jredis) SCARD(key string) int
- func (j *Jredis) SDIFF(keys ...string) []string
- func (j *Jredis) SDIFFSTORE(destination string, keys ...string) int
- func (j *Jredis) SET(key string, value interface{}) bool
- func (j *Jredis) SETBIT(key string, offset, value interface{}) int
- func (j *Jredis) SETEX(key string, value interface{}, expire int) bool
- func (j *Jredis) SETNX(key string, value interface{}, expire int) bool
- func (j *Jredis) SETRANGE(key string, offset, value interface{}) int
- func (j *Jredis) SINTER(keys ...string) []string
- func (j *Jredis) SINTERSTORE(destination string, keys ...string) int
- func (j *Jredis) SISMEMBER(key string, member interface{}) int
- func (j *Jredis) SMEMBERS(key string) []string
- func (j *Jredis) SMOVE(source, destination string, member interface{}) int
- func (j *Jredis) SORT(key string, start, size int, isReverse ...bool) ([]float64, error)
- func (j *Jredis) SPOP(key string, count ...int) []string
- func (j *Jredis) SRANDMEMBER(key string, count ...int) []string
- func (j *Jredis) SREM(key string, members ...interface{}) int
- func (j *Jredis) SSCAN(key string, count int, pattern ...string) []string
- func (j *Jredis) STRLEN(key string) int
- func (j *Jredis) SUNION(keys ...string) []string
- func (j *Jredis) SUNIONSTORE(destination string, keys ...string) int
- func (j *Jredis) TTL(key string) int
- func (j *Jredis) ZADD(key string, args ...interface{}) int
- func (j *Jredis) ZCARD(key string) int
- func (j *Jredis) ZCOUNT(key string, min, max float64) int
- func (j *Jredis) ZINCRBY(key string, increment float64, member interface{}) float64
- func (j *Jredis) ZLEXCOUNT(key string, min, max interface{}) int
- func (j *Jredis) ZRANGE(key string, start, stop int) (eles []string, scores []float64)
- func (j *Jredis) ZRANGEBYLEX(key string, min, max interface{}, limit ...interface{}) []string
- func (j *Jredis) ZRANGEBYSCORE(key string, min, max interface{}, limit ...interface{}) (eles []string, scores []float64)
- func (j *Jredis) ZRANK(key string, member interface{}) int
- func (j *Jredis) ZREM(key string, member ...interface{}) int
- func (j *Jredis) ZREMRANGEBYLEX(key string, min, max interface{}) int
- func (j *Jredis) ZREMRANGEBYRANK(key string, start, stop int) int
- func (j *Jredis) ZREMRANGEBYSCORE(key string, min, max interface{}) int
- func (j *Jredis) ZREVRANGE(key string, start, stop int) (eles []string, scores []float64)
- func (j *Jredis) ZREVRANGEBYLEX(key string, max, min interface{}, limit ...interface{}) []string
- func (j *Jredis) ZREVRANGEBYSCORE(key string, max, min interface{}, limit ...interface{}) (eles []string, scores []float64)
- func (j *Jredis) ZREVRANK(key string, member interface{}) int
- func (j *Jredis) ZSCAN(key string, count int, pattern ...string) map[string]string
- func (j *Jredis) ZSCORE(key string, member interface{}) (float64, error)
- type Option
- type RedisHasher
- type RedisKeyer
- type RedisLister
- type RedisSetter
- type RedisStringer
- type RedisZSetter
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRedisPool ¶
Types ¶
type Jredis ¶
type Jredis struct {
// contains filtered or unexported fields
}
func (*Jredis) APPEND ¶
If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case. APPEND key value
@return Integer reply: the length of the string after the append operation.
func (*Jredis) BRPOPLPUSH ¶
BRPOPLPUSH source destination timeout 从source右探出一个元素从左进入destination,阻塞时间为timeout,0为永久阻塞
func (*Jredis) DECR ¶
DECR key Time complexity: O(1) @return Integer reply: the value of key after the decrement
func (*Jredis) DECRBY ¶
DECRBY key decrement Time complexity: O(1) Decrements the number stored at key by decrement. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bit signed integers. @return Integer reply: the value of key after the decrement
func (*Jredis) GET ¶
GET key Time complexity: O(1) @return Bulk string reply: the value of key, or nil when key does not exist.
func (*Jredis) GETBIT ¶
GETBIT key offset Time complexity: O(1) @return Integer reply: the bit value stored at offset.
func (*Jredis) GETRANGE ¶
GETRANGE key start end Time complexity: O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings. @return Bulk string reply
func (*Jredis) GETSET ¶
GETSET key value Time complexity: O(1) Atomically sets key to value and returns the old value stored at key. Returns an error when key exists but does not hold a string value.
func (*Jredis) GetRealKey ¶
func (*Jredis) HDEL ¶
HDEL key field [field ...] Time complexity: O(N) where N is the number of fields to be removed. @return Integer reply: the number of fields that were removed from the hash, not including specified but non existing fields.
func (*Jredis) HEXISTS ¶
HEXISTS key field Time complexity: O(1) @return Integer reply, specifically:
1 if the hash contains field. 0 if the hash does not contain field, or key does not exist.
func (*Jredis) HGET ¶
HGET key field @return Bulk string reply: the value associated with field, or nil when field is not present in the hash or key does not exist.
func (*Jredis) HGETALL ¶
HGETALL key Time complexity: O(N) where N is the size of the hash. @return Array reply: list of fields and their values stored in the hash, or an empty list when key does not exist.
func (*Jredis) HINCRBY ¶
HINCRBY key field increment Time complexity: O(1) @return Integer reply: the value at field after the increment operation.
func (*Jredis) HINCRBYFLOAT ¶
HINCRBYFLOAT key field increment Time complexity: O(1) @return Bulk string reply: the value of field after the increment.
func (*Jredis) HKEYS ¶
HKEYS key Time complexity: O(N) where N is the size of the hash @return Array reply: list of fields in the hash, or an empty list when key does not exist.
func (*Jredis) HLEN ¶
HLEN key Time complexity: O(1) @return Integer reply: number of fields in the hash, or 0 when key does not exist.
func (*Jredis) HMGET ¶
HMGET key field [field ...] Time complexity: O(N) where N is the number of fields being requested. @return Array reply: list of values associated with the given fields, in the same order as they are requested.
func (*Jredis) HMSET ¶
HMSET key field value [field value ...] Time complexity: O(N) where N is the number of fields being set. @return Simple string reply
func (*Jredis) HSCAN ¶
HSCAN key cursor [MATCH pattern] [COUNT count] Available since 2.8.0. Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection..
func (*Jredis) HSET ¶
HSET key field value [field value ...] Time complexity: O(1) for each field/value pair added, so O(N) to add N field/value pairs when the command is called with multiple field/value pairs. @description Sets field in the hash stored at key to value. If key does not exist, a new key holding a hash is created.
If field already exists in the hash, it is overwritten. As of Redis 4.0.0, HSET is variadic and allows for multiple field/value pairs.
@return Integer reply: The number of fields that were added.
func (*Jredis) HSETNX ¶
HSETNX key field value Time complexity: O(1) @description Sets field in the hash stored at key to value, only if field does not yet exist.
If key does not exist, a new key holding a hash is created. If field already exists, this operation has no effect.
@return Integer reply, specifically:
1 if field is a new field in the hash and value was set. 0 if field already exists in the hash and no operation was performed.
func (*Jredis) HSTRLEN ¶
HSTRLEN key field Time complexity: O(1) @description Returns the string length of the value associated with field in the hash stored at key.
If the key or the field do not exist, 0 is returned.
@return Integer reply: the string length of the value associated with field,
or zero when field is not present in the hash or key does not exist at all.
func (*Jredis) HVALS ¶
HVALS key Time complexity: O(N) where N is the size of the hash. @return Array reply: list of values in the hash, or an empty list when key does not exist.
func (*Jredis) INCRBYFLOAT ¶
INCRBYFLOAT key increment Time complexity: O(1)
func (*Jredis) LINDEX ¶
LINDEX key index @return Bulk string reply: the requested element, or nil when index is out of range.
func (*Jredis) LINSERTAFTER ¶
LINSERT key BEFORE|AFTER pivot element @return Integer reply: the length of the list after the insert operation, or -1 when the value pivot was not found.
func (*Jredis) LINSERTBEFORE ¶
func (*Jredis) LPOP ¶
@return Bulk string reply: the value of the first element, or nil when key does not exist.
func (*Jredis) LPUSH ¶
LPUSH key element [element ...] @return Integer reply: the length of the list after the push operations.
func (*Jredis) LPUSHX ¶
LPUSHX key element [element ...] @description Inserts specified values at the head of the list stored at key, only if key already exists and holds a list. @return Bulk string reply: the value of the first element, or nil when key does not exist.
func (*Jredis) LRANGE ¶
LRANGE key start stop @return Array reply: list of elements in the specified range.
func (*Jredis) LREM ¶
LREM key count element @return Integer reply: the number of removed elements count > 0 : 从表头开始向表尾搜索,移除与 VALUE 相等的元素,数量为 COUNT 。 count < 0 : 从表尾开始向表头搜索,移除与 VALUE 相等的元素,数量为 COUNT 的绝对值。 count = 0 : 移除表中所有与 VALUE 相等的值。
func (*Jredis) LTRIM ¶
LTRIM key start stop @description Trim an existing list so that it will contain only the specified range of elements specified. 列表剪裁
func (*Jredis) MGET ¶
MGET key [key ...] Time complexity: O(N) where N is the number of keys to retrieve.
func (*Jredis) MSET ¶
MSET key value [key value ...] Time complexity: O(N) where N is the number of keys to retrieve.
func (*Jredis) MSETNX ¶
MSET key value [key value ...] Time complexity: O(N) where N is the number of keys to retrieve.
func (*Jredis) RPOP ¶
@return Bulk string reply: the value of the first element, or nil when key does not exist.
func (*Jredis) RPOPLPUSH ¶
RPOPLPUSH source destination 从source右弹出一个元素从左进入destination @return Bulk string reply: the element being popped and pushed.
func (*Jredis) RPUSH ¶
RPUSH key element [element ...] @return Integer reply: the length of the list after the push operations.
func (*Jredis) RPUSHX ¶
LPUSHX key element [element ...] @description Inserts specified values at the head of the list stored at key, only if key already exists and holds a list. @return Bulk string reply: the value of the first element, or nil when key does not exist.
func (*Jredis) SADD ¶
SADD key member [member ...] Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. @return Integer reply: the number of elements that were added to the set, not including all the elements already present into the set.
func (*Jredis) SCARD ¶
SCARD key @description Returns the set cardinality (number of elements) of the set stored at key. Integer reply: the cardinality (number of elements) of the set, or 0 if key does not exist.
func (*Jredis) SDIFF ¶
SDIFF key [key ...] Time complexity: O(N) where N is the total number of elements in all given sets. @description Returns the members of the set resulting from the difference between the first set and all the successive sets. @return Integer reply: the number of elements in the resulting set. 类似补集
func (*Jredis) SDIFFSTORE ¶
SDIFFSTORE destination key [key ...] Time complexity: O(N) where N is the total number of elements in all given sets. @description This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.
If destination already exists, it is overwritten.
@return Integer reply: the number of elements in the resulting set.
func (*Jredis) SETBIT ¶
SETBIT key offset value Time complexity: O(1) Sets or clears the bit at offset in the string value stored at key. The bit is either set or cleared depending on value, which can be either 0 or 1.
func (*Jredis) SETRANGE ¶
SETRANGE key offset value @return Integer reply: the length of the string after it was modified by the command.
func (*Jredis) SINTER ¶
SINTER key [key ...] Time complexity: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets. @description Returns the members of the set resulting from the intersection of all the given sets. @return Integer reply: the number of elements in the resulting set. 交集
func (*Jredis) SINTERSTORE ¶
SINTERSTORE destination key [key ...] Time complexity: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets. @description This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.
If destination already exists, it is overwritten.
@return Integer reply: the number of elements in the resulting set. 交集
func (*Jredis) SISMEMBER ¶
SISMEMBER key member Time complexity: O(1) @description Returns if member is a member of the set stored at key. @return Integer reply, specifically:
1 if the element is a member of the set. 0 if the element is not a member of the set, or if key does not exist.
func (*Jredis) SMEMBERS ¶
SMEMBERS key Time complexity: O(N) where N is the set cardinality. @description Returns all the members of the set value stored at key.This has the same effect as running SINTER with one argument key. @return Array reply: all elements of the set.
func (*Jredis) SMOVE ¶
SMOVE source destination member Time complexity: O(1) @description Move member from the set at source to the set at destination.This operation is atomic. @return Integer reply, specifically:
1 if the element is moved. 0 if the element is not a member of source and no operation was performed.
func (*Jredis) SPOP ¶
SPOP key [count] Time complexity: O(1) @description Removes and returns one or more random elements from the set value store at key. @return Bulk string reply: the removed element, or nil when key does not exist.
func (*Jredis) SRANDMEMBER ¶
SRANDMEMBER key [count] Time complexity: Without the count argument O(1), otherwise O(N) where N is the absolute value of the passed count. @description When called with just the key argument, return a random element from the set value stored at key. @return Return value
Bulk string reply: without the additional count argument the command returns a Bulk Reply with the randomly selected element, or nil when key does not exist. Array reply: when the additional count argument is passed the command returns an array of elements, or an empty array when key does not exist.
func (*Jredis) SREM ¶
SREM key member [member ...] Time complexity: O(N) where N is the number of members to be removed. @return Integer reply: the number of members that were removed from the set, not including non existing members.
func (*Jredis) SSCAN ¶
SSCAN key cursor [MATCH pattern] [COUNT count] Available since 2.8.0. Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection..
func (*Jredis) STRLEN ¶
STRLEN key @return Integer reply: the length of the string at key, or 0 when key does not exist.
func (*Jredis) SUNION ¶
SUNION key [key ...] Time complexity: O(N) where N is the total number of elements in all given sets. @description Returns the members of the set resulting from the union of all the given sets. @return Array reply: list with members of the resulting set.
func (*Jredis) SUNIONSTORE ¶
SUNIONSTORE destination key [key ...] Time complexity: O(N) where N is the total number of elements in all given sets @description This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.
If destination already exists, it is overwritten.
@return Integer reply: the number of elements in the resulting set. 交集
func (*Jredis) ZADD ¶
Time complexity: O(log(N)) for each item added, where N is the number of elements in the sorted set. XX: Only update elements that already exist. Never add elements. NX: Don't update already existing elements. Always add new elements. history
>= 2.4: Accepts multiple elements. In Redis versions older than 2.4 it was possible to add or update a single member per call. >= 3.0.2: Added the XX, NX, CH and INCR options. >=6.2: Added the GT and LT options.
@return Integer reply The number of elements added to the sorted set, not including elements already existing for which the score was updated.
func (*Jredis) ZCARD ¶
ZCARD key @description Returns the sorted set cardinality (number of elements) of the sorted set stored at key. @return Integer reply: the cardinality (number of elements) of the sorted set, or 0 if key does not exist.
func (*Jredis) ZCOUNT ¶
ZCOUNT key min max @description Returns the number of elements in the sorted set at key with a score between min and max. @return Integer reply: the number of elements in the specified score range.
func (*Jredis) ZINCRBY ¶
ZINCRBY key increment member @description Increments the score of member in the sorted set stored at key by increment.
If member does not exist in the sorted set, it is added with increment as its score (as if its previous score was 0.0). If key does not exist, a new sorted set with the specified member as its sole member is created.
@return Bulk string reply: the new score of member (a double precision floating point number), represented as string.
func (*Jredis) ZLEXCOUNT ¶
ZLEXCOUNT key min max Time complexity: O(log(N)) with N being the number of elements in the sorted set. @description When all the elements in a sorted set are inserted with the same score,
in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.
@return Integer reply: the number of elements in the specified score range.
func (*Jredis) ZRANGE ¶
ZRANGE key start stop [WITHSCORES] @description Returns the specified range of elements in the sorted set stored at key.
The elements are considered to be ordered from the lowest to the highest score. Lexicographical order is used for elements with equal score.
func (*Jredis) ZRANGEBYLEX ¶
ZRANGEBYLEX key min max [LIMIT offset count] @description When all the elements in a sorted set are inserted with the same score,
in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max.
min max: Valid start and stop must start with ( or [, in order to specify if the range item is respectively exclusive or inclusive.
The special values of + or - for start and stop have the special meaning or positively infinite and negatively infinite strings, so for instance the command ZRANGEBYLEX myzset - + is guaranteed to return all the elements in the sorted set, if all the elements have the same score.
@return Array reply: list of elements in the specified score range.
func (*Jredis) ZRANGEBYSCORE ¶
func (j *Jredis) ZRANGEBYSCORE(key string, min, max interface{}, limit ...interface{}) (eles []string, scores []float64)
ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count] @description Returns all the elements in the sorted set at key with a score between min and max
(including elements with score equal to min or max). The elements are considered to be ordered from low to high scores.
@usage ZRANGEBYSCORE zset (5 (10 ZRANGEBYSCORE zset -inf +inf @return Array reply: list of elements in the specified score range (optionally with their scores).
func (*Jredis) ZRANK ¶
ZRANK key member @description Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.
The rank (or index) is 0-based, which means that the member with the lowest score has rank 0.
@return
If member exists in the sorted set, Integer reply: the rank of member. If member does not exist in the sorted set or key does not exist, Bulk string reply: nil.
func (*Jredis) ZREM ¶
ZREM key member [member ...] Time complexity: O(M*log(N)) with N being the number of elements in the sorted set and M the number of elements to be removed. @description Removes the specified members from the sorted set stored at key. Non existing members are ignored. @return Integer reply, The number of members removed from the sorted set, not including non existing members.
func (*Jredis) ZREMRANGEBYLEX ¶
ZREMRANGEBYLEX key min max @description When all the elements in a sorted set are inserted with the same score,
in order to force lexicographical ordering, this command removes all elements in the sorted set stored at key between the lexicographical range specified by min and max.
@usage ZREMRANGEBYLEX myzset [alpha [omega
func (*Jredis) ZREMRANGEBYRANK ¶
ZREMRANGEBYRANK key start stop @description Removes all elements in the sorted set stored at key with rank between start and stop.
Both start and stop are 0 -based indexes with 0 being the element with the lowest score. These indexes can be negative numbers, where they indicate offsets starting at the element with the highest score. For example: -1 is the element with the highest score, -2 the element with the second highest score and so forth.
func (*Jredis) ZREMRANGEBYSCORE ¶
ZREMRANGEBYSCORE key min max @description Removes all elements in the sorted set stored at key with a score between min and max (inclusive).
func (*Jredis) ZREVRANGE ¶
ZREVRANGE key start stop [WITHSCORES] @description Returns the specified range of elements in the sorted set stored at key.
The elements are considered to be ordered from the highest to the lowest score. Descending lexicographical order is used for elements with equal score.
func (*Jredis) ZREVRANGEBYLEX ¶
ZREVRANGEBYLEX key max min [LIMIT offset count]
func (*Jredis) ZREVRANGEBYSCORE ¶
func (j *Jredis) ZREVRANGEBYSCORE(key string, max, min interface{}, limit ...interface{}) (eles []string, scores []float64)
ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]
func (*Jredis) ZREVRANK ¶
ZREVRANK key member @description Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.
The rank (or index) is 0-based, which means that the member with the highest score has rank 0.
type RedisHasher ¶
type RedisHasher interface { HDEL(key string, fields ...interface{}) int HEXISTS(key string, field interface{}) int HGET(key string, field interface{}) string HGETALL(key string) map[string]string HINCRBY(key string, field interface{}, increment int) int HINCRBYFLOAT(key string, field interface{}, increment float64) float64 HKEYS(key string) []string HLEN(key string) int HMGET(key string, fields ...interface{}) []string HMSET(key string, mapKv map[interface{}]interface{}) bool HSCAN(key string, count int, pattern ...string) map[string]string HSET(key string, field, value interface{}) int HSETNX(key string, field, value interface{}) int HSTRLEN(key string, field interface{}) int HVALS(key string) []string RedisKeyer }
type RedisKeyer ¶
type RedisLister ¶
type RedisLister interface { BLPOP(timeout int, keys ...string) []string BRPOP(timeout int, keys ...string) []string BRPOPLPUSH(source, destination string, timeout int) string LINDEX(key string, index int) string LINSERTAFTER(key string, privot, value interface{}) int LINSERTBEFORE(key string, privot, value interface{}) int LLEN(key string) int LPOP(key string) string LPUSH(key string, values ...interface{}) int LPUSHX(key string, values ...interface{}) int LRANGE(key string, start, stop int) []string LREM(key string, count int, value interface{}) int LSET(key string, index int, value interface{}) bool LTRIM(key string, start, stop int) bool RPOP(key string) string RPOPLPUSH(source, destination string) string RPUSH(key string, values ...interface{}) int RPUSHX(key string, values ...interface{}) int RedisKeyer }
type RedisSetter ¶
type RedisSetter interface { SADD(key string, val ...interface{}) int SCARD(key string) int SDIFF(keys ...string) []string SDIFFSTORE(destination string, keys ...string) int SINTER(keys ...string) []string SINTERSTORE(destination string, keys ...string) int SISMEMBER(key string, member interface{}) int SMEMBERS(key string) []string SMOVE(source, destination string, member interface{}) int SPOP(key string, count ...int) []string SRANDMEMBER(key string, count ...int) []string SREM(key string, members ...interface{}) int SSCAN(key string, count int, pattern ...string) []string SUNION(keys ...string) []string SUNIONSTORE(destination string, keys ...string) int RedisKeyer }
type RedisStringer ¶
type RedisStringer interface { SET(key string, value interface{}) bool SETEX(key string, value interface{}, expire int) bool SETNX(key string, value interface{}, expire int) bool GET(key string) string APPEND(key string, value interface{}) int DECR(key string) int DECRBY(key string, decrement interface{}) int GETBIT(key string, offset interface{}) int SETBIT(key string, offset, value interface{}) int GETRANGE(key string, start, end interface{}) string GETSET(key string, value interface{}) string INCR(key string) int INCRBY(key string, decrement interface{}) int INCRBYFLOAT(key string, decrement interface{}) float64 MGET(keys ...string) []string MSET(mapKv map[string]interface{}) bool MSETNX(mapKv map[string]interface{}) int SETRANGE(key string, offset, value interface{}) int STRLEN(key string) int RedisKeyer }
type RedisZSetter ¶
type RedisZSetter interface { ZADD(key string, args ...interface{}) int ZCARD(key string) int ZCOUNT(key string, min, max float64) int ZINCRBY(key string, increment float64, member interface{}) float64 ZLEXCOUNT(key string, min, max interface{}) int ZRANGE(key string, start, stop int) (eles []string, scores []float64) ZRANGEBYLEX(key string, min, max interface{}, limit ...interface{}) []string ZRANGEBYSCORE(key string, min, max interface{}, limit ...interface{}) (eles []string, scores []float64) ZRANK(key string, member interface{}) int ZREM(key string, member ...interface{}) int ZREMRANGEBYLEX(key string, min, max interface{}) int ZREMRANGEBYRANK(key string, start, stop int) int ZREMRANGEBYSCORE(key string, min, max interface{}) int ZREVRANGE(key string, start, stop int) (eles []string, scores []float64) ZREVRANGEBYLEX(key string, max, min interface{}, limit ...interface{}) []string ZREVRANGEBYSCORE(key string, max, min interface{}, limit ...interface{}) (eles []string, scores []float64) ZREVRANK(key string, member interface{}) int ZSCAN(key string, count int, pattern ...string) map[string]string ZSCORE(key string, member interface{}) (float64, error) RedisKeyer }