redis

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 9 Imported by: 7

README

Documentation

Overview

Package redis provides operations for redis commands.

Package redis is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	Recorder func(Driver) Driver
	Replayer func(Driver) Driver
)

Functions

func ErrNil

func ErrNil() error

ErrNil returns the `errNil` error.

func IsErrNil

func IsErrNil(err error) bool

IsErrNil returns whether err is the `errNil` error.

func IsOK

func IsOK(s string) bool

IsOK returns whether s equals "OK".

Types

type Case added in v1.1.3

type Case struct {
	Func func(t *testing.T, ctx context.Context, c *Client)
	Skip bool
	Data string
}

type Cases added in v1.1.3

type Cases struct{}

func (*Cases) Append added in v1.1.3

func (c *Cases) Append() *Case

func (*Cases) BitCount added in v1.1.3

func (c *Cases) BitCount() *Case

func (*Cases) BitOpAnd added in v1.1.3

func (c *Cases) BitOpAnd() *Case

func (*Cases) BitPos added in v1.1.3

func (c *Cases) BitPos() *Case

func (*Cases) Decr added in v1.1.3

func (c *Cases) Decr() *Case

func (*Cases) DecrBy added in v1.1.3

func (c *Cases) DecrBy() *Case

func (*Cases) Del added in v1.1.3

func (c *Cases) Del() *Case

func (*Cases) Dump added in v1.1.3

func (c *Cases) Dump() *Case

func (*Cases) Exists added in v1.1.3

func (c *Cases) Exists() *Case

func (*Cases) Expire added in v1.1.3

func (c *Cases) Expire() *Case

func (*Cases) ExpireAt added in v1.1.3

func (c *Cases) ExpireAt() *Case

func (*Cases) Get added in v1.1.3

func (c *Cases) Get() *Case

func (*Cases) GetBit added in v1.1.3

func (c *Cases) GetBit() *Case

func (*Cases) GetDel added in v1.1.3

func (c *Cases) GetDel() *Case

func (*Cases) GetRange added in v1.1.3

func (c *Cases) GetRange() *Case

func (*Cases) GetSet added in v1.1.3

func (c *Cases) GetSet() *Case

func (*Cases) HDel added in v1.1.3

func (c *Cases) HDel() *Case

func (*Cases) HExists added in v1.1.3

func (c *Cases) HExists() *Case

func (*Cases) HGet added in v1.1.3

func (c *Cases) HGet() *Case

func (*Cases) HGetAll added in v1.1.3

func (c *Cases) HGetAll() *Case

func (*Cases) HIncrBy added in v1.1.3

func (c *Cases) HIncrBy() *Case

func (*Cases) HIncrByFloat added in v1.1.3

func (c *Cases) HIncrByFloat() *Case

func (*Cases) HKeys added in v1.1.3

func (c *Cases) HKeys() *Case

func (*Cases) HLen added in v1.1.3

func (c *Cases) HLen() *Case

func (*Cases) HMGet added in v1.1.3

func (c *Cases) HMGet() *Case

func (*Cases) HSet added in v1.1.3

func (c *Cases) HSet() *Case

func (*Cases) HSetNX added in v1.1.3

func (c *Cases) HSetNX() *Case

func (*Cases) HStrLen added in v1.1.3

func (c *Cases) HStrLen() *Case

func (*Cases) HVals added in v1.1.3

func (c *Cases) HVals() *Case

func (*Cases) Incr added in v1.1.3

func (c *Cases) Incr() *Case

func (*Cases) IncrBy added in v1.1.3

func (c *Cases) IncrBy() *Case

func (*Cases) IncrByFloat added in v1.1.3

func (c *Cases) IncrByFloat() *Case

func (*Cases) Keys added in v1.1.3

func (c *Cases) Keys() *Case

func (*Cases) LIndex added in v1.1.3

func (c *Cases) LIndex() *Case

func (*Cases) LInsert added in v1.1.3

func (c *Cases) LInsert() *Case

func (*Cases) LLen added in v1.1.3

func (c *Cases) LLen() *Case

func (*Cases) LMove added in v1.1.3

func (c *Cases) LMove() *Case

func (*Cases) LPop added in v1.1.3

func (c *Cases) LPop() *Case

func (*Cases) LPos added in v1.1.3

func (c *Cases) LPos() *Case

func (*Cases) LPush added in v1.1.3

func (c *Cases) LPush() *Case

func (*Cases) LPushX added in v1.1.3

func (c *Cases) LPushX() *Case

func (*Cases) LRange added in v1.1.3

func (c *Cases) LRange() *Case

func (*Cases) LRem added in v1.1.3

func (c *Cases) LRem() *Case

func (*Cases) LSet added in v1.1.3

func (c *Cases) LSet() *Case

func (*Cases) LTrim added in v1.1.3

func (c *Cases) LTrim() *Case

func (*Cases) MGet added in v1.1.3

func (c *Cases) MGet() *Case

func (*Cases) MSet added in v1.1.3

func (c *Cases) MSet() *Case

func (*Cases) MSetNX added in v1.1.3

func (c *Cases) MSetNX() *Case

func (*Cases) PExpire added in v1.1.3

func (c *Cases) PExpire() *Case

func (*Cases) PExpireAt added in v1.1.3

func (c *Cases) PExpireAt() *Case

func (*Cases) PSetEX added in v1.1.3

func (c *Cases) PSetEX() *Case

func (*Cases) PTTL added in v1.1.3

func (c *Cases) PTTL() *Case

func (*Cases) Persist added in v1.1.3

func (c *Cases) Persist() *Case

func (*Cases) RPop added in v1.1.3

func (c *Cases) RPop() *Case

func (*Cases) RPopLPush added in v1.1.3

func (c *Cases) RPopLPush() *Case

func (*Cases) RPush added in v1.1.3

func (c *Cases) RPush() *Case

func (*Cases) RPushX added in v1.1.3

func (c *Cases) RPushX() *Case

func (*Cases) Rename added in v1.1.3

func (c *Cases) Rename() *Case

func (*Cases) RenameNX added in v1.1.3

func (c *Cases) RenameNX() *Case

func (*Cases) SAdd added in v1.1.3

func (c *Cases) SAdd() *Case

func (*Cases) SCard added in v1.1.3

func (c *Cases) SCard() *Case

func (*Cases) SDiff added in v1.1.3

func (c *Cases) SDiff() *Case

func (*Cases) SDiffStore added in v1.1.3

func (c *Cases) SDiffStore() *Case

func (*Cases) SInter added in v1.1.3

func (c *Cases) SInter() *Case

func (*Cases) SInterStore added in v1.1.3

func (c *Cases) SInterStore() *Case

func (*Cases) SIsMember added in v1.1.3

func (c *Cases) SIsMember() *Case

func (*Cases) SMIsMember added in v1.1.3

func (c *Cases) SMIsMember() *Case

func (*Cases) SMembers added in v1.1.3

func (c *Cases) SMembers() *Case

func (*Cases) SMove added in v1.1.3

func (c *Cases) SMove() *Case

func (*Cases) SPop added in v1.1.3

func (c *Cases) SPop() *Case

func (*Cases) SRandMember added in v1.1.3

func (c *Cases) SRandMember() *Case

func (*Cases) SRem added in v1.1.3

func (c *Cases) SRem() *Case

func (*Cases) SUnion added in v1.1.3

func (c *Cases) SUnion() *Case

func (*Cases) SUnionStore added in v1.1.3

func (c *Cases) SUnionStore() *Case

func (*Cases) Set added in v1.1.3

func (c *Cases) Set() *Case

func (*Cases) SetBit added in v1.1.3

func (c *Cases) SetBit() *Case

func (*Cases) SetEX added in v1.1.3

func (c *Cases) SetEX() *Case

func (*Cases) SetNX added in v1.1.3

func (c *Cases) SetNX() *Case

func (*Cases) SetRange added in v1.1.3

func (c *Cases) SetRange() *Case

func (*Cases) StrLen added in v1.1.3

func (c *Cases) StrLen() *Case

func (*Cases) TTL added in v1.1.3

func (c *Cases) TTL() *Case

func (*Cases) Touch added in v1.1.3

func (c *Cases) Touch() *Case

func (*Cases) Type added in v1.1.3

func (c *Cases) Type() *Case

func (*Cases) ZAdd added in v1.1.3

func (c *Cases) ZAdd() *Case

func (*Cases) ZCard added in v1.1.3

func (c *Cases) ZCard() *Case

func (*Cases) ZCount added in v1.1.3

func (c *Cases) ZCount() *Case

func (*Cases) ZDiff added in v1.1.3

func (c *Cases) ZDiff() *Case

func (*Cases) ZIncrBy added in v1.1.3

func (c *Cases) ZIncrBy() *Case

func (*Cases) ZInter added in v1.1.3

func (c *Cases) ZInter() *Case

func (*Cases) ZLexCount added in v1.1.3

func (c *Cases) ZLexCount() *Case

func (*Cases) ZMScore added in v1.1.3

func (c *Cases) ZMScore() *Case

func (*Cases) ZPopMax added in v1.1.3

func (c *Cases) ZPopMax() *Case

func (*Cases) ZPopMin added in v1.1.3

func (c *Cases) ZPopMin() *Case

func (*Cases) ZRandMember added in v1.1.3

func (c *Cases) ZRandMember() *Case

func (*Cases) ZRange added in v1.1.3

func (c *Cases) ZRange() *Case

func (*Cases) ZRangeByLex added in v1.1.3

func (c *Cases) ZRangeByLex() *Case

func (*Cases) ZRangeByScore added in v1.1.3

func (c *Cases) ZRangeByScore() *Case

func (*Cases) ZRank added in v1.1.3

func (c *Cases) ZRank() *Case

func (*Cases) ZRem added in v1.1.3

func (c *Cases) ZRem() *Case

func (*Cases) ZRemRangeByLex added in v1.1.3

func (c *Cases) ZRemRangeByLex() *Case

func (*Cases) ZRemRangeByRank added in v1.1.3

func (c *Cases) ZRemRangeByRank() *Case

func (*Cases) ZRemRangeByScore added in v1.1.3

func (c *Cases) ZRemRangeByScore() *Case

func (*Cases) ZRevRange added in v1.1.3

func (c *Cases) ZRevRange() *Case

func (*Cases) ZRevRangeByLex added in v1.1.3

func (c *Cases) ZRevRangeByLex() *Case

func (*Cases) ZRevRangeByScore added in v1.1.3

func (c *Cases) ZRevRangeByScore() *Case

func (*Cases) ZRevRank added in v1.1.3

func (c *Cases) ZRevRank() *Case

func (*Cases) ZScore added in v1.1.3

func (c *Cases) ZScore() *Case

func (*Cases) ZUnion added in v1.1.3

func (c *Cases) ZUnion() *Case

func (*Cases) ZUnionStore added in v1.1.3

func (c *Cases) ZUnionStore() *Case

type Client

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

Client provides operations for redis commands.

func NewClient

func NewClient(driver Driver) *Client

NewClient returns a new *Client.

func (*Client) Append added in v1.1.3

func (c *Client) Append(ctx context.Context, key, value string) (int64, error)

Append https://redis.io/commands/append Command: APPEND key value Integer reply: the length of the string after the append operation.

func (*Client) BitCount added in v1.1.3

func (c *Client) BitCount(ctx context.Context, key string, args ...interface{}) (int64, error)

BitCount https://redis.io/commands/bitcount Command: BITCOUNT key [start end] Integer reply: The number of bits set to 1.

func (*Client) BitOpAnd added in v1.1.3

func (c *Client) BitOpAnd(ctx context.Context, destKey string, keys ...string) (int64, error)

BitOpAnd https://redis.io/commands/bitop Command: BITOP AND destkey srckey1 srckey2 srckey3 ... srckeyN Integer reply: The size of the string stored in the destination key, that is equal to the size of the longest input string.

func (*Client) BitOpNot added in v1.1.3

func (c *Client) BitOpNot(ctx context.Context, destKey string, key string) (int64, error)

BitOpNot https://redis.io/commands/bitop Command: BITOP NOT destkey srckey Integer reply: The size of the string stored in the destination key, that is equal to the size of the longest input string.

func (*Client) BitOpOr added in v1.1.3

func (c *Client) BitOpOr(ctx context.Context, destKey string, keys ...string) (int64, error)

BitOpOr https://redis.io/commands/bitop Command: BITOP OR destkey srckey1 srckey2 srckey3 ... srckeyN Integer reply: The size of the string stored in the destination key, that is equal to the size of the longest input string.

func (*Client) BitOpXor added in v1.1.3

func (c *Client) BitOpXor(ctx context.Context, destKey string, keys ...string) (int64, error)

BitOpXor https://redis.io/commands/bitop Command: BITOP XOR destkey srckey1 srckey2 srckey3 ... srckeyN Integer reply: The size of the string stored in the destination key, that is equal to the size of the longest input string.

func (*Client) BitPos added in v1.1.3

func (c *Client) BitPos(ctx context.Context, key string, bit int64, args ...interface{}) (int64, error)

BitPos https://redis.io/commands/bitpos Command: BITPOS key bit [start [end]] Integer reply: The command returns the position of the first bit set to 1 or 0 according to the request.

func (*Client) Decr added in v1.1.3

func (c *Client) Decr(ctx context.Context, key string) (int64, error)

Decr https://redis.io/commands/decr Command: DECR key Integer reply: the value of key after the decrement

func (*Client) DecrBy added in v1.1.3

func (c *Client) DecrBy(ctx context.Context, key string, decrement int64) (int64, error)

DecrBy https://redis.io/commands/decrby Command: DECRBY key decrement Integer reply: the value of key after the decrement.

func (*Client) Del added in v1.1.3

func (c *Client) Del(ctx context.Context, keys ...string) (int64, error)

Del https://redis.io/commands/del Command: DEL key [key ...] Integer reply: The number of keys that were removed.

func (*Client) Dump added in v1.1.3

func (c *Client) Dump(ctx context.Context, key string) (string, error)

Dump https://redis.io/commands/dump Command: DUMP key Bulk string reply: the serialized value. If key does not exist a nil bulk reply is returned.

func (*Client) Exists added in v1.1.3

func (c *Client) Exists(ctx context.Context, keys ...string) (int64, error)

Exists https://redis.io/commands/exists Command: EXISTS key [key ...] Integer reply: The number of keys existing among the ones specified as arguments. Keys mentioned multiple times and existing are counted multiple times.

func (*Client) Expire added in v1.1.3

func (c *Client) Expire(ctx context.Context, key string, expire int64, args ...interface{}) (int64, error)

Expire https://redis.io/commands/expire Command: EXPIRE key seconds [NX|XX|GT|LT] Integer reply: 1 if the timeout was set, 0 if the timeout was not set.

func (*Client) ExpireAt added in v1.1.3

func (c *Client) ExpireAt(ctx context.Context, key string, expireAt int64, args ...interface{}) (int64, error)

ExpireAt https://redis.io/commands/expireat Command: EXPIREAT key timestamp [NX|XX|GT|LT] Integer reply: 1 if the timeout was set, 0 if the timeout was not set.

func (*Client) Float

func (c *Client) Float(ctx context.Context, args ...interface{}) (float64, error)

Float executes a command whose reply is a `float64`.

func (*Client) FloatSlice

func (c *Client) FloatSlice(ctx context.Context, args ...interface{}) ([]float64, error)

FloatSlice executes a command whose reply is a `[]float64`.

func (*Client) FlushAll added in v1.1.3

func (c *Client) FlushAll(ctx context.Context, args ...interface{}) (string, error)

FlushAll https://redis.io/commands/flushall Command: FLUSHALL [ASYNC|SYNC] Simple string reply

func (*Client) Get added in v1.1.3

func (c *Client) Get(ctx context.Context, key string) (string, error)

Get https://redis.io/commands/get Command: GET key Bulk string reply: the value of key, or nil when key does not exist.

func (*Client) GetBit added in v1.1.3

func (c *Client) GetBit(ctx context.Context, key string, offset int64) (int64, error)

GetBit https://redis.io/commands/getbit Command: GETBIT key offset Integer reply: the bit value stored at offset.

func (*Client) GetDel added in v1.1.3

func (c *Client) GetDel(ctx context.Context, key string) (string, error)

GetDel https://redis.io/commands/getdel Command: GETDEL key Bulk string reply: the value of key, nil when key does not exist, or an error if the key's value type isn't a string.

func (*Client) GetEx added in v1.1.3

func (c *Client) GetEx(ctx context.Context, key string, args ...interface{}) (string, error)

GetEx https://redis.io/commands/getex Command: GETEX key [EX seconds|PX milliseconds|EXAT timestamp|PXAT milliseconds-timestamp|PERSIST] Bulk string reply: the value of key, or nil when key does not exist.

func (*Client) GetRange added in v1.1.3

func (c *Client) GetRange(ctx context.Context, key string, start, end int64) (string, error)

GetRange https://redis.io/commands/getrange Command: GETRANGE key start end Bulk string reply

func (*Client) GetSet added in v1.1.3

func (c *Client) GetSet(ctx context.Context, key string, value interface{}) (string, error)

GetSet https://redis.io/commands/getset Command: GETSET key value Bulk string reply: the old value stored at key, or nil when key did not exist.

func (*Client) HDel added in v1.1.3

func (c *Client) HDel(ctx context.Context, key string, fields ...string) (int64, error)

HDel https://redis.io/commands/hdel Command: HDEL key field [field ...] Integer reply: the number of fields that were removed from the hash, not including specified but non-existing fields.

func (*Client) HExists added in v1.1.3

func (c *Client) HExists(ctx context.Context, key, field string) (int64, error)

HExists https://redis.io/commands/hexists Command: HEXISTS key field Integer reply: 1 if the hash contains field, 0 if the hash does not contain field, or key does not exist.

func (*Client) HGet added in v1.1.3

func (c *Client) HGet(ctx context.Context, key string, field string) (string, error)

HGet https://redis.io/commands/hget Command: HGET key field Bulk string reply: the value associated with field, or nil when field is not present in the hash or key does not exist.

func (*Client) HGetAll added in v1.1.3

func (c *Client) HGetAll(ctx context.Context, key string) (map[string]string, error)

HGetAll https://redis.io/commands/hgetall Command: HGETALL key Array reply: list of fields and their values stored in the hash, or an empty list when key does not exist.

func (*Client) HIncrBy added in v1.1.3

func (c *Client) HIncrBy(ctx context.Context, key, field string, incr int64) (int64, error)

HIncrBy https://redis.io/commands/hincrby Command: HINCRBY key field increment Integer reply: the value at field after the increment operation.

func (*Client) HIncrByFloat added in v1.1.3

func (c *Client) HIncrByFloat(ctx context.Context, key, field string, incr float64) (float64, error)

HIncrByFloat https://redis.io/commands/hincrbyfloat Command: HINCRBYFLOAT key field increment Bulk string reply: the value of field after the increment.

func (*Client) HKeys added in v1.1.3

func (c *Client) HKeys(ctx context.Context, key string) ([]string, error)

HKeys https://redis.io/commands/hkeys Command: HKEYS key Array reply: list of fields in the hash, or an empty list when key does not exist.

func (*Client) HLen added in v1.1.3

func (c *Client) HLen(ctx context.Context, key string) (int64, error)

HLen https://redis.io/commands/hlen Command: HLEN key Integer reply: number of fields in the hash, or 0 when key does not exist.

func (*Client) HMGet added in v1.1.3

func (c *Client) HMGet(ctx context.Context, key string, fields ...string) ([]interface{}, error)

HMGet https://redis.io/commands/hmget Command: HMGET key field [field ...] Array reply: list of values associated with the given fields, in the same order as they are requested.

func (*Client) HSet added in v1.1.3

func (c *Client) HSet(ctx context.Context, key string, args ...interface{}) (int64, error)

HSet https://redis.io/commands/hset Command: HSET key field value [field value ...] Integer reply: The number of fields that were added.

func (*Client) HSetNX added in v1.1.3

func (c *Client) HSetNX(ctx context.Context, key, field string, value interface{}) (int64, error)

HSetNX https://redis.io/commands/hsetnx Command: HSETNX key field value Integer reply: 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 (*Client) HStrLen added in v1.1.3

func (c *Client) HStrLen(ctx context.Context, key, field string) (int64, error)

HStrLen https://redis.io/commands/hstrlen Command: HSTRLEN key field 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 (*Client) HVals added in v1.1.3

func (c *Client) HVals(ctx context.Context, key string) ([]string, error)

HVals https://redis.io/commands/hvals Command: HVALS key Array reply: list of values in the hash, or an empty list when key does not exist.

func (*Client) Incr added in v1.1.3

func (c *Client) Incr(ctx context.Context, key string) (int64, error)

Incr https://redis.io/commands/incr Command: INCR key Integer reply: the value of key after the increment

func (*Client) IncrBy added in v1.1.3

func (c *Client) IncrBy(ctx context.Context, key string, value int64) (int64, error)

IncrBy https://redis.io/commands/incrby Command: INCRBY key increment Integer reply: the value of key after the increment.

func (*Client) IncrByFloat added in v1.1.3

func (c *Client) IncrByFloat(ctx context.Context, key string, value float64) (float64, error)

IncrByFloat https://redis.io/commands/incrbyfloat Command: INCRBYFLOAT key increment Bulk string reply: the value of key after the increment.

func (*Client) Int

func (c *Client) Int(ctx context.Context, args ...interface{}) (int64, error)

Int executes a command whose reply is a `int64`.

func (*Client) IntSlice

func (c *Client) IntSlice(ctx context.Context, args ...interface{}) ([]int64, error)

IntSlice executes a command whose reply is a `[]int64`.

func (*Client) Keys added in v1.1.3

func (c *Client) Keys(ctx context.Context, pattern string) ([]string, error)

Keys https://redis.io/commands/keys Command: KEYS pattern Array reply: list of keys matching pattern.

func (*Client) LIndex added in v1.1.3

func (c *Client) LIndex(ctx context.Context, key string, index int64) (string, error)

LIndex https://redis.io/commands/lindex Command: LINDEX key index Bulk string reply: the requested element, or nil when index is out of range.

func (*Client) LInsertAfter added in v1.1.3

func (c *Client) LInsertAfter(ctx context.Context, key string, pivot, value interface{}) (int64, error)

LInsertAfter https://redis.io/commands/linsert Command: LINSERT key BEFORE|AFTER pivot element Integer reply: the length of the list after the insert operation, or -1 when the value pivot was not found.

func (*Client) LInsertBefore added in v1.1.3

func (c *Client) LInsertBefore(ctx context.Context, key string, pivot, value interface{}) (int64, error)

LInsertBefore https://redis.io/commands/linsert Command: LINSERT key BEFORE|AFTER pivot element Integer reply: the length of the list after the insert operation, or -1 when the value pivot was not found.

func (*Client) LLen added in v1.1.3

func (c *Client) LLen(ctx context.Context, key string) (int64, error)

LLen https://redis.io/commands/llen Command: LLEN key Integer reply: the length of the list at key.

func (*Client) LMove added in v1.1.3

func (c *Client) LMove(ctx context.Context, source, destination, srcPos, destPos string) (string, error)

LMove https://redis.io/commands/lmove Command: LMOVE source destination LEFT|RIGHT LEFT|RIGHT Bulk string reply: the element being popped and pushed.

func (*Client) LPop added in v1.1.3

func (c *Client) LPop(ctx context.Context, key string) (string, error)

LPop https://redis.io/commands/lpop Command: LPOP key [count] Bulk string reply: the value of the first element, or nil when key does not exist.

func (*Client) LPopN added in v1.1.3

func (c *Client) LPopN(ctx context.Context, key string, count int) ([]string, error)

LPopN https://redis.io/commands/lpop Command: LPOP key [count] Array reply: list of popped elements, or nil when key does not exist.

func (*Client) LPos added in v1.1.3

func (c *Client) LPos(ctx context.Context, key string, value interface{}, args ...interface{}) (int64, error)

LPos https://redis.io/commands/lpos Command: LPOS key element [RANK rank] [COUNT num-matches] [MAXLEN len] The command returns the integer representing the matching element, or nil if there is no match. However, if the COUNT option is given the command returns an array (empty if there are no matches).

func (*Client) LPosN added in v1.1.3

func (c *Client) LPosN(ctx context.Context, key string, value interface{}, count int64, args ...interface{}) ([]int64, error)

LPosN https://redis.io/commands/lpos Command: LPOS key element [RANK rank] [COUNT num-matches] [MAXLEN len] The command returns the integer representing the matching element, or nil if there is no match. However, if the COUNT option is given the command returns an array (empty if there are no matches).

func (*Client) LPush added in v1.1.3

func (c *Client) LPush(ctx context.Context, key string, values ...interface{}) (int64, error)

LPush https://redis.io/commands/lpush Command: LPUSH key element [element ...] Integer reply: the length of the list after the push operations.

func (*Client) LPushX added in v1.1.3

func (c *Client) LPushX(ctx context.Context, key string, values ...interface{}) (int64, error)

LPushX https://redis.io/commands/lpushx Command: LPUSHX key element [element ...] Integer reply: the length of the list after the push operation.

func (*Client) LRange added in v1.1.3

func (c *Client) LRange(ctx context.Context, key string, start, stop int64) ([]string, error)

LRange https://redis.io/commands/lrange Command: LRANGE key start stop Array reply: list of elements in the specified range.

func (*Client) LRem added in v1.1.3

func (c *Client) LRem(ctx context.Context, key string, count int64, value interface{}) (int64, error)

LRem https://redis.io/commands/lrem Command: LREM key count element Integer reply: the number of removed elements.

func (*Client) LSet added in v1.1.3

func (c *Client) LSet(ctx context.Context, key string, index int64, value interface{}) (string, error)

LSet https://redis.io/commands/lset Command: LSET key index element Simple string reply

func (*Client) LTrim added in v1.1.3

func (c *Client) LTrim(ctx context.Context, key string, start, stop int64) (string, error)

LTrim https://redis.io/commands/ltrim Command: LTRIM key start stop Simple string reply

func (*Client) MGet added in v1.1.3

func (c *Client) MGet(ctx context.Context, keys ...string) ([]interface{}, error)

MGet https://redis.io/commands/mget Command: MGET key [key ...] Array reply: list of values at the specified keys.

func (*Client) MSet added in v1.1.3

func (c *Client) MSet(ctx context.Context, args ...interface{}) (string, error)

MSet https://redis.io/commands/mset Command: MSET key value [key value ...] Simple string reply: always OK since MSET can't fail.

func (*Client) MSetNX added in v1.1.3

func (c *Client) MSetNX(ctx context.Context, args ...interface{}) (int64, error)

MSetNX https://redis.io/commands/msetnx Command: MSETNX key value [key value ...] MSETNX is atomic, so all given keys are set at once Integer reply: 1 if the all the keys were set, 0 if no key was set (at least one key already existed).

func (*Client) PExpire added in v1.1.3

func (c *Client) PExpire(ctx context.Context, key string, expire int64, args ...interface{}) (int64, error)

PExpire https://redis.io/commands/pexpire Command: PEXPIRE key milliseconds [NX|XX|GT|LT] Integer reply: 1 if the timeout was set, 0 if the timeout was not set.

func (*Client) PExpireAt added in v1.1.3

func (c *Client) PExpireAt(ctx context.Context, key string, expireAt int64, args ...interface{}) (int64, error)

PExpireAt https://redis.io/commands/pexpireat Command: PEXPIREAT key milliseconds-timestamp [NX|XX|GT|LT] Integer reply: 1 if the timeout was set, 0 if the timeout was not set.

func (*Client) PSetEX added in v1.1.3

func (c *Client) PSetEX(ctx context.Context, key string, value interface{}, expire int64) (string, error)

PSetEX https://redis.io/commands/psetex Command: PSETEX key milliseconds value Simple string reply

func (*Client) PTTL added in v1.1.3

func (c *Client) PTTL(ctx context.Context, key string) (int64, error)

PTTL https://redis.io/commands/pttl Command: PTTL key Integer reply: TTL in milliseconds, -1 if the key exists but has no associated expire, -2 if the key does not exist.

func (*Client) Persist added in v1.1.3

func (c *Client) Persist(ctx context.Context, key string) (int64, error)

Persist https://redis.io/commands/persist Command: PERSIST key Integer reply: 1 if the timeout was removed, 0 if key does not exist or does not have an associated timeout.

func (*Client) RPop added in v1.1.3

func (c *Client) RPop(ctx context.Context, key string) (string, error)

RPop https://redis.io/commands/rpop Command: RPOP key [count] Bulk string reply: the value of the last element, or nil when key does not exist.

func (*Client) RPopLPush added in v1.1.3

func (c *Client) RPopLPush(ctx context.Context, source, destination string) (string, error)

RPopLPush https://redis.io/commands/rpoplpush Command: RPOPLPUSH source destination Bulk string reply: the element being popped and pushed.

func (*Client) RPopN added in v1.1.3

func (c *Client) RPopN(ctx context.Context, key string, count int) ([]string, error)

RPopN https://redis.io/commands/rpop Command: RPOP key [count] Array reply: list of popped elements, or nil when key does not exist.

func (*Client) RPush added in v1.1.3

func (c *Client) RPush(ctx context.Context, key string, values ...interface{}) (int64, error)

RPush https://redis.io/commands/rpush Command: RPUSH key element [element ...] Integer reply: the length of the list after the push operation.

func (*Client) RPushX added in v1.1.3

func (c *Client) RPushX(ctx context.Context, key string, values ...interface{}) (int64, error)

RPushX https://redis.io/commands/rpushx Command: RPUSHX key element [element ...] Integer reply: the length of the list after the push operation.

func (*Client) RandomKey added in v1.1.3

func (c *Client) RandomKey(ctx context.Context) (string, error)

RandomKey https://redis.io/commands/randomkey Command: RANDOMKEY Bulk string reply: the random key, or nil when the database is empty.

func (*Client) Rename added in v1.1.3

func (c *Client) Rename(ctx context.Context, key, newKey string) (string, error)

Rename https://redis.io/commands/rename Command: RENAME key newkey Simple string reply.

func (*Client) RenameNX added in v1.1.3

func (c *Client) RenameNX(ctx context.Context, key, newKey string) (int64, error)

RenameNX https://redis.io/commands/renamenx Command: RENAMENX key newkey Integer reply: 1 if key was renamed to newKey, 0 if newKey already exists.

func (*Client) SAdd added in v1.1.3

func (c *Client) SAdd(ctx context.Context, key string, members ...interface{}) (int64, error)

SAdd https://redis.io/commands/sadd Command: SADD key member [member ...] Integer reply: the number of elements that were added to the set, not including all the elements already present in the set.

func (*Client) SCard added in v1.1.3

func (c *Client) SCard(ctx context.Context, key string) (int64, error)

SCard https://redis.io/commands/scard Command: SCARD key Integer reply: the cardinality (number of elements) of the set, or 0 if key does not exist.

func (*Client) SDiff added in v1.1.3

func (c *Client) SDiff(ctx context.Context, keys ...string) ([]string, error)

SDiff https://redis.io/commands/sdiff Command: SDIFF key [key ...] Array reply: list with members of the resulting set.

func (*Client) SDiffStore added in v1.1.3

func (c *Client) SDiffStore(ctx context.Context, destination string, keys ...string) (int64, error)

SDiffStore https://redis.io/commands/sdiffstore Command: SDIFFSTORE destination key [key ...] Integer reply: the number of elements in the resulting set.

func (*Client) SInter added in v1.1.3

func (c *Client) SInter(ctx context.Context, keys ...string) ([]string, error)

SInter https://redis.io/commands/sinter Command: SINTER key [key ...] Array reply: list with members of the resulting set.

func (*Client) SInterStore added in v1.1.3

func (c *Client) SInterStore(ctx context.Context, destination string, keys ...string) (int64, error)

SInterStore https://redis.io/commands/sinterstore Command: SINTERSTORE destination key [key ...] Integer reply: the number of elements in the resulting set.

func (*Client) SIsMember added in v1.1.3

func (c *Client) SIsMember(ctx context.Context, key string, member interface{}) (int64, error)

SIsMember https://redis.io/commands/sismember Command: SISMEMBER key member Integer reply: 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 (*Client) SMIsMember added in v1.1.3

func (c *Client) SMIsMember(ctx context.Context, key string, members ...interface{}) ([]int64, error)

SMIsMember https://redis.io/commands/smismember Command: SMISMEMBER key member [member ...] Array reply: list representing the membership of the given elements, in the same order as they are requested.

func (*Client) SMembers added in v1.1.3

func (c *Client) SMembers(ctx context.Context, key string) ([]string, error)

SMembers https://redis.io/commands/smembers Command: SMEMBERS key Array reply: all elements of the set.

func (*Client) SMove added in v1.1.3

func (c *Client) SMove(ctx context.Context, source, destination string, member interface{}) (int64, error)

SMove https://redis.io/commands/smove Command: SMOVE source destination member Integer reply: 1 if the element is moved, 0 if the element is not a member of source and no operation was performed.

func (*Client) SPop added in v1.1.3

func (c *Client) SPop(ctx context.Context, key string) (string, error)

SPop https://redis.io/commands/spop Command: SPOP key [count] Bulk string reply: the removed member, or nil when key does not exist.

func (*Client) SPopN added in v1.1.3

func (c *Client) SPopN(ctx context.Context, key string, count int64) ([]string, error)

SPopN https://redis.io/commands/spop Command: SPOP key [count] Array reply: the removed members, or an empty array when key does not exist.

func (*Client) SRandMember added in v1.1.3

func (c *Client) SRandMember(ctx context.Context, key string) (string, error)

SRandMember https://redis.io/commands/srandmember Command: SRANDMEMBER key [count] Returns a Bulk Reply with the randomly selected element, or nil when key does not exist.

func (*Client) SRandMemberN added in v1.1.3

func (c *Client) SRandMemberN(ctx context.Context, key string, count int64) ([]string, error)

SRandMemberN https://redis.io/commands/srandmember Command: SRANDMEMBER key [count] Returns an array of elements, or an empty array when key does not exist.

func (*Client) SRem added in v1.1.3

func (c *Client) SRem(ctx context.Context, key string, members ...interface{}) (int64, error)

SRem https://redis.io/commands/srem Command: SREM key member [member ...] Integer reply: the number of members that were removed from the set, not including non-existing members.

func (*Client) SUnion added in v1.1.3

func (c *Client) SUnion(ctx context.Context, keys ...string) ([]string, error)

SUnion https://redis.io/commands/sunion Command: SUNION key [key ...] Array reply: list with members of the resulting set.

func (*Client) SUnionStore added in v1.1.3

func (c *Client) SUnionStore(ctx context.Context, destination string, keys ...string) (int64, error)

SUnionStore https://redis.io/commands/sunionstore Command: SUNIONSTORE destination key [key ...] Integer reply: the number of elements in the resulting set.

func (*Client) Set added in v1.1.3

func (c *Client) Set(ctx context.Context, key string, value interface{}, args ...interface{}) (string, error)

Set https://redis.io/commands/set Command: SET key value [EX seconds|PX milliseconds|EXAT timestamp|PXAT milliseconds-timestamp|KEEPTTL] [NX|XX] [GET] Simple string reply: OK if SET was executed correctly.

func (*Client) SetBit added in v1.1.3

func (c *Client) SetBit(ctx context.Context, key string, offset int64, value int) (int64, error)

SetBit https://redis.io/commands/setbit Command: SETBIT key offset value Integer reply: the original bit value stored at offset.

func (*Client) SetEX added in v1.1.3

func (c *Client) SetEX(ctx context.Context, key string, value interface{}, expire int64) (string, error)

SetEX https://redis.io/commands/setex Command: SETEX key seconds value Simple string reply

func (*Client) SetNX added in v1.1.3

func (c *Client) SetNX(ctx context.Context, key string, value interface{}) (int64, error)

SetNX https://redis.io/commands/setnx Command: SETNX key value Integer reply: 1 if the key was set, 0 if the key was not set.

func (*Client) SetRange added in v1.1.3

func (c *Client) SetRange(ctx context.Context, key string, offset int64, value string) (int64, error)

SetRange https://redis.io/commands/setrange Command: SETRANGE key offset value Integer reply: the length of the string after it was modified by the command.

func (*Client) Slice

func (c *Client) Slice(ctx context.Context, args ...interface{}) ([]interface{}, error)

Slice executes a command whose reply is a `[]interface{}`.

func (*Client) StrLen added in v1.1.3

func (c *Client) StrLen(ctx context.Context, key string) (int64, error)

StrLen https://redis.io/commands/strlen Command: STRLEN key Integer reply: the length of the string at key, or 0 when key does not exist.

func (*Client) String

func (c *Client) String(ctx context.Context, args ...interface{}) (string, error)

String executes a command whose reply is a `string`.

func (*Client) StringMap

func (c *Client) StringMap(ctx context.Context, args ...interface{}) (map[string]string, error)

StringMap executes a command whose reply is a `map[string]string`.

func (*Client) StringSlice

func (c *Client) StringSlice(ctx context.Context, args ...interface{}) ([]string, error)

StringSlice executes a command whose reply is a `[]string`.

func (*Client) TTL added in v1.1.3

func (c *Client) TTL(ctx context.Context, key string) (int64, error)

TTL https://redis.io/commands/ttl Command: TTL key Integer reply: TTL in seconds, -1 if the key exists but has no associated expire, -2 if the key does not exist.

func (*Client) Touch added in v1.1.3

func (c *Client) Touch(ctx context.Context, keys ...string) (int64, error)

Touch https://redis.io/commands/touch Command: TOUCH key [key ...] Integer reply: The number of keys that were touched.

func (*Client) Type added in v1.1.3

func (c *Client) Type(ctx context.Context, key string) (string, error)

Type https://redis.io/commands/type Command: TYPE key Simple string reply: type of key, or none when key does not exist.

func (*Client) ZAdd added in v1.1.3

func (c *Client) ZAdd(ctx context.Context, key string, args ...interface{}) (int64, error)

ZAdd https://redis.io/commands/zadd Command: ZADD key [NX|XX] [GT|LT] [CH] [INCR] score member [score member ...] Integer reply, the number of elements added to the sorted set (excluding score updates).

func (*Client) ZCard added in v1.1.3

func (c *Client) ZCard(ctx context.Context, key string) (int64, error)

ZCard https://redis.io/commands/zcard Command: ZCARD key Integer reply: the cardinality (number of elements) of the sorted set, or 0 if key does not exist.

func (*Client) ZCount added in v1.1.3

func (c *Client) ZCount(ctx context.Context, key, min, max string) (int64, error)

ZCount https://redis.io/commands/zcount Command: ZCOUNT key min max Integer reply: the number of elements in the specified score range.

func (*Client) ZDiff added in v1.1.3

func (c *Client) ZDiff(ctx context.Context, keys ...string) ([]string, error)

ZDiff https://redis.io/commands/zdiff Command: ZDIFF numkeys key [key ...] [WITHSCORES] Array reply: the result of the difference.

func (*Client) ZDiffWithScores added in v1.1.3

func (c *Client) ZDiffWithScores(ctx context.Context, keys ...string) ([]ZItem, error)

ZDiffWithScores https://redis.io/commands/zdiff Command: ZDIFF numkeys key [key ...] [WITHSCORES] Array reply: the result of the difference.

func (*Client) ZIncrBy added in v1.1.3

func (c *Client) ZIncrBy(ctx context.Context, key string, increment float64, member string) (float64, error)

ZIncrBy https://redis.io/commands/zincrby Command: ZINCRBY key increment member Bulk string reply: the new score of member (a double precision floating point number), represented as string.

func (*Client) ZInter added in v1.1.3

func (c *Client) ZInter(ctx context.Context, args ...interface{}) ([]string, error)

ZInter https://redis.io/commands/zinter Command: ZINTER numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX] [WITHSCORES] Array reply: the result of intersection.

func (*Client) ZInterWithScores added in v1.1.3

func (c *Client) ZInterWithScores(ctx context.Context, args ...interface{}) ([]ZItem, error)

ZInterWithScores https://redis.io/commands/zinter Command: ZINTER numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX] [WITHSCORES] Array reply: the result of intersection.

func (*Client) ZItemSlice

func (c *Client) ZItemSlice(ctx context.Context, args ...interface{}) ([]ZItem, error)

ZItemSlice executes a command whose reply is a `[]ZItem`.

func (*Client) ZLexCount added in v1.1.3

func (c *Client) ZLexCount(ctx context.Context, key, min, max string) (int64, error)

ZLexCount https://redis.io/commands/zlexcount Command: ZLEXCOUNT key min max Integer reply: the number of elements in the specified score range.

func (*Client) ZMScore added in v1.1.3

func (c *Client) ZMScore(ctx context.Context, key string, members ...string) ([]float64, error)

ZMScore https://redis.io/commands/zmscore Command: ZMSCORE key member [member ...] Array reply: list of scores or nil associated with the specified member values (a double precision floating point number), represented as strings.

func (*Client) ZPopMax added in v1.1.3

func (c *Client) ZPopMax(ctx context.Context, key string) ([]ZItem, error)

ZPopMax https://redis.io/commands/zpopmax Command: ZPOPMAX key [count] Array reply: list of popped elements and scores.

func (*Client) ZPopMaxN added in v1.1.3

func (c *Client) ZPopMaxN(ctx context.Context, key string, count int64) ([]ZItem, error)

ZPopMaxN https://redis.io/commands/zpopmax Command: ZPOPMAX key [count] Array reply: list of popped elements and scores.

func (*Client) ZPopMin added in v1.1.3

func (c *Client) ZPopMin(ctx context.Context, key string) ([]ZItem, error)

ZPopMin https://redis.io/commands/zpopmin Command: ZPOPMIN key [count] Array reply: list of popped elements and scores.

func (*Client) ZPopMinN added in v1.1.3

func (c *Client) ZPopMinN(ctx context.Context, key string, count int64) ([]ZItem, error)

ZPopMinN https://redis.io/commands/zpopmin Command: ZPOPMIN key [count] Array reply: list of popped elements and scores.

func (*Client) ZRandMember added in v1.1.3

func (c *Client) ZRandMember(ctx context.Context, key string) (string, error)

ZRandMember https://redis.io/commands/zrandmember Command: ZRANDMEMBER key [count [WITHSCORES]] Bulk Reply with the randomly selected element, or nil when key does not exist.

func (*Client) ZRandMemberN added in v1.1.3

func (c *Client) ZRandMemberN(ctx context.Context, key string, count int) ([]string, error)

ZRandMemberN https://redis.io/commands/zrandmember Command: ZRANDMEMBER key [count [WITHSCORES]] Bulk Reply with the randomly selected element, or nil when key does not exist.

func (*Client) ZRandMemberWithScores added in v1.1.3

func (c *Client) ZRandMemberWithScores(ctx context.Context, key string, count int) ([]ZItem, error)

ZRandMemberWithScores https://redis.io/commands/zrandmember Command: ZRANDMEMBER key [count [WITHSCORES]] Bulk Reply with the randomly selected element, or nil when key does not exist.

func (*Client) ZRange added in v1.1.3

func (c *Client) ZRange(ctx context.Context, key string, start, stop int64, args ...interface{}) ([]string, error)

ZRange https://redis.io/commands/zrange Command: ZRANGE key min max [BYSCORE|BYLEX] [REV] [LIMIT offset count] [WITHSCORES] Array reply: list of elements in the specified range.

func (*Client) ZRangeByLex added in v1.1.3

func (c *Client) ZRangeByLex(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)

ZRangeByLex https://redis.io/commands/zrangebylex Command: ZRANGEBYLEX key min max [LIMIT offset count] Array reply: list of elements in the specified score range.

func (*Client) ZRangeByScore added in v1.1.3

func (c *Client) ZRangeByScore(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)

ZRangeByScore https://redis.io/commands/zrangebyscore Command: ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count] Array reply: list of elements in the specified score range.

func (*Client) ZRangeWithScores added in v1.1.3

func (c *Client) ZRangeWithScores(ctx context.Context, key string, start, stop int64, args ...interface{}) ([]ZItem, error)

ZRangeWithScores https://redis.io/commands/zrange Command: ZRANGE key min max [BYSCORE|BYLEX] [REV] [LIMIT offset count] [WITHSCORES] Array reply: list of elements in the specified range.

func (*Client) ZRank added in v1.1.3

func (c *Client) ZRank(ctx context.Context, key, member string) (int64, error)

ZRank https://redis.io/commands/zrank Command: ZRANK key member 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 (*Client) ZRem added in v1.1.3

func (c *Client) ZRem(ctx context.Context, key string, members ...interface{}) (int64, error)

ZRem https://redis.io/commands/zrem Command: ZREM key member [member ...] Integer reply, The number of members removed from the sorted set, not including non existing members.

func (*Client) ZRemRangeByLex added in v1.1.3

func (c *Client) ZRemRangeByLex(ctx context.Context, key, min, max string) (int64, error)

ZRemRangeByLex https://redis.io/commands/zremrangebylex Command: ZREMRANGEBYLEX key min max Integer reply: the number of elements removed.

func (*Client) ZRemRangeByRank added in v1.1.3

func (c *Client) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (int64, error)

ZRemRangeByRank https://redis.io/commands/zremrangebyrank Command: ZREMRANGEBYRANK key start stop Integer reply: the number of elements removed.

func (*Client) ZRemRangeByScore added in v1.1.3

func (c *Client) ZRemRangeByScore(ctx context.Context, key, min, max string) (int64, error)

ZRemRangeByScore https://redis.io/commands/zremrangebyscore Command: ZREMRANGEBYSCORE key min max Integer reply: the number of elements removed.

func (*Client) ZRevRange added in v1.1.3

func (c *Client) ZRevRange(ctx context.Context, key string, start, stop int64) ([]string, error)

ZRevRange https://redis.io/commands/zrevrange Command: ZREVRANGE key start stop [WITHSCORES] Array reply: list of elements in the specified range.

func (*Client) ZRevRangeByLex added in v1.1.3

func (c *Client) ZRevRangeByLex(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)

ZRevRangeByLex https://redis.io/commands/zrevrangebylex Command: ZREVRANGEBYLEX key max min [LIMIT offset count] Array reply: list of elements in the specified score range.

func (*Client) ZRevRangeByScore added in v1.1.3

func (c *Client) ZRevRangeByScore(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)

ZRevRangeByScore https://redis.io/commands/zrevrangebyscore Command: ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count] Array reply: list of elements in the specified score range.

func (*Client) ZRevRangeWithScores added in v1.1.3

func (c *Client) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]string, error)

ZRevRangeWithScores https://redis.io/commands/zrevrange Command: ZREVRANGE key start stop [WITHSCORES] Array reply: list of elements in the specified range.

func (*Client) ZRevRank added in v1.1.3

func (c *Client) ZRevRank(ctx context.Context, key, member string) (int64, error)

ZRevRank https://redis.io/commands/zrevrank Command: ZREVRANK key member 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 (*Client) ZScore added in v1.1.3

func (c *Client) ZScore(ctx context.Context, key, member string) (float64, error)

ZScore https://redis.io/commands/zscore Command: ZSCORE key member Bulk string reply: the score of member (a double precision floating point number), represented as string.

func (*Client) ZUnion added in v1.1.3

func (c *Client) ZUnion(ctx context.Context, args ...interface{}) ([]string, error)

ZUnion https://redis.io/commands/zunion Command: ZUNION numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX] [WITHSCORES] Array reply: the result of union.

func (*Client) ZUnionStore added in v1.1.3

func (c *Client) ZUnionStore(ctx context.Context, dest string, args ...interface{}) (int64, error)

ZUnionStore https://redis.io/commands/zunionstore Command: ZUNIONSTORE destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX] Integer reply: the number of elements in the resulting sorted set at destination.

func (*Client) ZUnionWithScores added in v1.1.3

func (c *Client) ZUnionWithScores(ctx context.Context, args ...interface{}) ([]ZItem, error)

ZUnionWithScores https://redis.io/commands/zunion Command: ZUNION numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX] [WITHSCORES] Array reply: the result of union.

type Config

type Config struct {
	Host           string `value:"${host:=127.0.0.1}"`
	Port           int    `value:"${port:=6379}"`
	Username       string `value:"${username:=}"`
	Password       string `value:"${password:=}"`
	Database       int    `value:"${database:=0}"`
	Ping           bool   `value:"${ping:=true}"`
	IdleTimeout    int    `value:"${idle-timeout:=0}"`
	ConnectTimeout int    `value:"${connect-timeout:=0}"`
	ReadTimeout    int    `value:"${read-timeout:=0}"`
	WriteTimeout   int    `value:"${write-timeout:=0}"`
}

Config Is the configuration of redis client.

type Driver added in v1.1.3

type Driver interface {
	Exec(ctx context.Context, args []interface{}) (interface{}, error)
}

type MockDriver added in v1.1.3

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

MockDriver is a mock of Driver interface.

func NewMockDriver added in v1.1.3

func NewMockDriver(ctrl *gomock.Controller) *MockDriver

NewMockDriver creates a new mock instance.

func (*MockDriver) EXPECT added in v1.1.3

func (m *MockDriver) EXPECT() *MockDriverMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockDriver) Exec added in v1.1.3

func (m *MockDriver) Exec(ctx context.Context, args []interface{}) (interface{}, error)

Exec mocks base method.

type MockDriverMockRecorder added in v1.1.3

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

MockDriverMockRecorder is the mock recorder for MockDriver.

func (*MockDriverMockRecorder) Exec added in v1.1.3

func (mr *MockDriverMockRecorder) Exec(ctx, args interface{}) *gomock.Call

Exec indicates an expected call of Exec.

type Result added in v1.1.3

type Result struct {
	Data []string
}

type ZItem

type ZItem struct {
	Member interface{}
	Score  float64
}

Jump to

Keyboard shortcuts

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