jredis

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRedisPool

func RegisterRedisPool(host, port string, options ...Option)

func SetDebug

func SetDebug(d ...bool)

Types

type Conf

type Conf struct {
	// contains filtered or unexported fields
}

type Jredis

type Jredis struct {
	// contains filtered or unexported fields
}

func NewRedis

func NewRedis(module ...string) *Jredis
Example
r := NewRedis("test")
fmt.Println(r.module)
Output:

test

func (*Jredis) APPEND

func (j *Jredis) APPEND(key string, value interface{}) int
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) BLPOP

func (j *Jredis) BLPOP(timeout int, keys ...string) []string

BLPOP key [key ...] timeout

func (*Jredis) BRPOP

func (j *Jredis) BRPOP(timeout int, keys ...string) []string

BRPOP key [key ...] timeout

func (*Jredis) BRPOPLPUSH

func (j *Jredis) BRPOPLPUSH(source, destination string, timeout int) string

BRPOPLPUSH source destination timeout 从source右探出一个元素从左进入destination,阻塞时间为timeout,0为永久阻塞

func (*Jredis) Client

func (j *Jredis) Client() (redis.Conn, error)

func (*Jredis) DECR

func (j *Jredis) DECR(key string) int

DECR key Time complexity: O(1) @return Integer reply: the value of key after the decrement

func (*Jredis) DECRBY

func (j *Jredis) DECRBY(key string, decrement interface{}) int

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) DEL

func (j *Jredis) DEL(keys ...string) int

func (*Jredis) EXEC

func (j *Jredis) EXEC(conn redis.Conn, cmd string, args ...interface{}) (interface{}, error)

func (*Jredis) EXISTS

func (j *Jredis) EXISTS(key string) int

func (*Jredis) EXPIRE

func (j *Jredis) EXPIRE(key string, expire int) int

func (*Jredis) GET

func (j *Jredis) GET(key string) string

GET key Time complexity: O(1) @return Bulk string reply: the value of key, or nil when key does not exist.

func (*Jredis) GETBIT

func (j *Jredis) GETBIT(key string, offset interface{}) int

GETBIT key offset Time complexity: O(1) @return Integer reply: the bit value stored at offset.

func (*Jredis) GETRANGE

func (j *Jredis) GETRANGE(key string, start, end interface{}) string

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

func (j *Jredis) GETSET(key string, value interface{}) string

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 (j *Jredis) GetRealKey(key string) string

func (*Jredis) HDEL

func (j *Jredis) HDEL(key string, fields ...interface{}) int

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

func (j *Jredis) HEXISTS(key string, field interface{}) int

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

func (j *Jredis) HGET(key string, field interface{}) string

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

func (j *Jredis) HGETALL(key string) map[string]string

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

func (j *Jredis) HINCRBY(key string, field interface{}, increment int) int

HINCRBY key field increment Time complexity: O(1) @return Integer reply: the value at field after the increment operation.

func (*Jredis) HINCRBYFLOAT

func (j *Jredis) HINCRBYFLOAT(key string, field interface{}, increment float64) float64

HINCRBYFLOAT key field increment Time complexity: O(1) @return Bulk string reply: the value of field after the increment.

func (*Jredis) HKEYS

func (j *Jredis) HKEYS(key string) []string

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

func (j *Jredis) HLEN(key string) int

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

func (j *Jredis) HMGET(key string, fields ...interface{}) []string

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

func (j *Jredis) HMSET(key string, mapKv map[interface{}]interface{}) bool

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

func (j *Jredis) HSCAN(key string, count int, pattern ...string) map[string]string

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

func (j *Jredis) HSET(key string, field, value interface{}) int

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

func (j *Jredis) HSETNX(key string, field, value interface{}) int

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

func (j *Jredis) HSTRLEN(key string, field interface{}) int

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

func (j *Jredis) HVALS(key string) []string

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) INCR

func (j *Jredis) INCR(key string) int

INCR key Time complexity: O(1)

func (*Jredis) INCRBY

func (j *Jredis) INCRBY(key string, decrement interface{}) int

INCRBY key increment Time complexity: O(1)

func (*Jredis) INCRBYFLOAT

func (j *Jredis) INCRBYFLOAT(key string, decrement interface{}) float64

INCRBYFLOAT key increment Time complexity: O(1)

func (*Jredis) LINDEX

func (j *Jredis) LINDEX(key string, index int) string

LINDEX key index @return Bulk string reply: the requested element, or nil when index is out of range.

func (*Jredis) LINSERTAFTER

func (j *Jredis) LINSERTAFTER(key string, privot, value interface{}) int

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 (j *Jredis) LINSERTBEFORE(key string, privot, value interface{}) int

func (*Jredis) LLEN

func (j *Jredis) LLEN(key string) int

@return integer reply: the length of the list at key.

func (*Jredis) LPOP

func (j *Jredis) LPOP(key string) string

@return Bulk string reply: the value of the first element, or nil when key does not exist.

func (*Jredis) LPUSH

func (j *Jredis) LPUSH(key string, values ...interface{}) int

LPUSH key element [element ...] @return Integer reply: the length of the list after the push operations.

func (*Jredis) LPUSHX

func (j *Jredis) LPUSHX(key string, values ...interface{}) int

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

func (j *Jredis) LRANGE(key string, start, stop int) []string

LRANGE key start stop @return Array reply: list of elements in the specified range.

func (*Jredis) LREM

func (j *Jredis) LREM(key string, count int, value interface{}) int

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) LSET

func (j *Jredis) LSET(key string, index int, value interface{}) bool

LSET key index element @return An error is returned for out of range indexes.

func (*Jredis) LTRIM

func (j *Jredis) LTRIM(key string, start, stop int) bool

LTRIM key start stop @description Trim an existing list so that it will contain only the specified range of elements specified. 列表剪裁

func (*Jredis) MGET

func (j *Jredis) MGET(keys ...string) []string

MGET key [key ...] Time complexity: O(N) where N is the number of keys to retrieve.

func (*Jredis) MSET

func (j *Jredis) MSET(mapKv map[string]interface{}) bool

MSET key value [key value ...] Time complexity: O(N) where N is the number of keys to retrieve.

func (*Jredis) MSETNX

func (j *Jredis) MSETNX(mapKv map[string]interface{}) int

MSET key value [key value ...] Time complexity: O(N) where N is the number of keys to retrieve.

func (*Jredis) RENAME

func (j *Jredis) RENAME(key, newKey string) bool

func (*Jredis) RPOP

func (j *Jredis) RPOP(key string) string

@return Bulk string reply: the value of the first element, or nil when key does not exist.

func (*Jredis) RPOPLPUSH

func (j *Jredis) RPOPLPUSH(source, destination string) string

RPOPLPUSH source destination 从source右弹出一个元素从左进入destination @return Bulk string reply: the element being popped and pushed.

func (*Jredis) RPUSH

func (j *Jredis) RPUSH(key string, values ...interface{}) int

RPUSH key element [element ...] @return Integer reply: the length of the list after the push operations.

func (*Jredis) RPUSHX

func (j *Jredis) RPUSHX(key string, values ...interface{}) int

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

func (j *Jredis) SADD(key string, val ...interface{}) int

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) SCAN

func (j *Jredis) SCAN(count int, pattern ...string) []string

func (*Jredis) SCARD

func (j *Jredis) SCARD(key string) int

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

func (j *Jredis) SDIFF(keys ...string) []string

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

func (j *Jredis) SDIFFSTORE(destination string, keys ...string) int

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) SET

func (j *Jredis) SET(key string, value interface{}) bool

func (*Jredis) SETBIT

func (j *Jredis) SETBIT(key string, offset, value interface{}) int

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) SETEX

func (j *Jredis) SETEX(key string, value interface{}, expire int) bool

设置过期时间

func (*Jredis) SETNX

func (j *Jredis) SETNX(key string, value interface{}, expire int) bool

加锁

func (*Jredis) SETRANGE

func (j *Jredis) SETRANGE(key string, offset, value interface{}) int

SETRANGE key offset value @return Integer reply: the length of the string after it was modified by the command.

func (*Jredis) SINTER

func (j *Jredis) SINTER(keys ...string) []string

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

func (j *Jredis) SINTERSTORE(destination string, keys ...string) int

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

func (j *Jredis) SISMEMBER(key string, member interface{}) int

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

func (j *Jredis) SMEMBERS(key string) []string

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

func (j *Jredis) SMOVE(source, destination string, member interface{}) int

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) SORT

func (j *Jredis) SORT(key string, start, size int, isReverse ...bool) ([]float64, error)

isReverse 是否倒序

func (*Jredis) SPOP

func (j *Jredis) SPOP(key string, count ...int) []string

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

func (j *Jredis) SRANDMEMBER(key string, count ...int) []string

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

func (j *Jredis) SREM(key string, members ...interface{}) int

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

func (j *Jredis) SSCAN(key string, count int, pattern ...string) []string

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

func (j *Jredis) STRLEN(key string) int

STRLEN key @return Integer reply: the length of the string at key, or 0 when key does not exist.

func (*Jredis) SUNION

func (j *Jredis) SUNION(keys ...string) []string

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

func (j *Jredis) SUNIONSTORE(destination string, keys ...string) int

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) TTL

func (j *Jredis) TTL(key string) int

-1 永不过期 -2 key不存在 大于0 剩余时间

func (*Jredis) ZADD

func (j *Jredis) ZADD(key string, args ...interface{}) int

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

func (j *Jredis) ZCARD(key string) int

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

func (j *Jredis) ZCOUNT(key string, min, max float64) int

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

func (j *Jredis) ZINCRBY(key string, increment float64, member interface{}) float64

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

func (j *Jredis) ZLEXCOUNT(key string, min, max interface{}) int

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

func (j *Jredis) ZRANGE(key string, start, stop int) (eles []string, scores []float64)

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

func (j *Jredis) ZRANGEBYLEX(key string, min, max interface{}, limit ...interface{}) []string

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

func (j *Jredis) ZRANK(key string, member interface{}) int

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

func (j *Jredis) ZREM(key string, member ...interface{}) int

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

func (j *Jredis) ZREMRANGEBYLEX(key string, min, max interface{}) int

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

func (j *Jredis) ZREMRANGEBYRANK(key string, start, stop int) int

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

func (j *Jredis) ZREMRANGEBYSCORE(key string, min, max interface{}) int

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

func (j *Jredis) ZREVRANGE(key string, start, stop int) (eles []string, scores []float64)

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

func (j *Jredis) ZREVRANGEBYLEX(key string, max, min interface{}, limit ...interface{}) []string

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

func (j *Jredis) ZREVRANK(key string, member interface{}) int

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.

func (*Jredis) ZSCAN

func (j *Jredis) ZSCAN(key string, count int, pattern ...string) map[string]string

ZSCAN key cursor [MATCH pattern] [COUNT count]

func (*Jredis) ZSCORE

func (j *Jredis) ZSCORE(key string, member interface{}) (float64, error)

ZSCORE key member @description Returns the score of member in the sorted set at key. @return Bulk string reply: the score of member (a double precision floating point number), represented as string.

type Option

type Option func(*Conf)

func AuthConf

func AuthConf(auth string) Option

func IsDefaultModule

func IsDefaultModule(b bool) Option

func ModuleConf

func ModuleConf(module string) Option

func PrefixConf

func PrefixConf(prefixKey string) Option

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 RedisKeyer interface {
	DEL(keys ...string) int
	EXPIRE(key string, expire int) int
	TTL(key string) int
	EXISTS(key string) int
	RENAME(key, newKey string) bool
	SCAN(count int, pattern ...string) []string
	SORT(key string, start, size int, isReverse ...bool) ([]float64, error)
}

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
}

Jump to

Keyboard shortcuts

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