Documentation
¶
Overview ¶
Package redis provides operations for redis commands.
Package redis is a generated GoMock package.
Index ¶
- Variables
- func ErrNil() error
- func IsErrNil(err error) bool
- func IsOK(s string) bool
- type Case
- type Cases
- func (c *Cases) Append() *Case
- func (c *Cases) BitCount() *Case
- func (c *Cases) BitOpAnd() *Case
- func (c *Cases) BitPos() *Case
- func (c *Cases) Decr() *Case
- func (c *Cases) DecrBy() *Case
- func (c *Cases) Del() *Case
- func (c *Cases) Dump() *Case
- func (c *Cases) Exists() *Case
- func (c *Cases) Expire() *Case
- func (c *Cases) ExpireAt() *Case
- func (c *Cases) Get() *Case
- func (c *Cases) GetBit() *Case
- func (c *Cases) GetDel() *Case
- func (c *Cases) GetRange() *Case
- func (c *Cases) GetSet() *Case
- func (c *Cases) HDel() *Case
- func (c *Cases) HExists() *Case
- func (c *Cases) HGet() *Case
- func (c *Cases) HGetAll() *Case
- func (c *Cases) HIncrBy() *Case
- func (c *Cases) HIncrByFloat() *Case
- func (c *Cases) HKeys() *Case
- func (c *Cases) HLen() *Case
- func (c *Cases) HMGet() *Case
- func (c *Cases) HSet() *Case
- func (c *Cases) HSetNX() *Case
- func (c *Cases) HStrLen() *Case
- func (c *Cases) HVals() *Case
- func (c *Cases) Incr() *Case
- func (c *Cases) IncrBy() *Case
- func (c *Cases) IncrByFloat() *Case
- func (c *Cases) Keys() *Case
- func (c *Cases) LIndex() *Case
- func (c *Cases) LInsert() *Case
- func (c *Cases) LLen() *Case
- func (c *Cases) LMove() *Case
- func (c *Cases) LPop() *Case
- func (c *Cases) LPos() *Case
- func (c *Cases) LPush() *Case
- func (c *Cases) LPushX() *Case
- func (c *Cases) LRange() *Case
- func (c *Cases) LRem() *Case
- func (c *Cases) LSet() *Case
- func (c *Cases) LTrim() *Case
- func (c *Cases) MGet() *Case
- func (c *Cases) MSet() *Case
- func (c *Cases) MSetNX() *Case
- func (c *Cases) PExpire() *Case
- func (c *Cases) PExpireAt() *Case
- func (c *Cases) PSetEX() *Case
- func (c *Cases) PTTL() *Case
- func (c *Cases) Persist() *Case
- func (c *Cases) RPop() *Case
- func (c *Cases) RPopLPush() *Case
- func (c *Cases) RPush() *Case
- func (c *Cases) RPushX() *Case
- func (c *Cases) Rename() *Case
- func (c *Cases) RenameNX() *Case
- func (c *Cases) SAdd() *Case
- func (c *Cases) SCard() *Case
- func (c *Cases) SDiff() *Case
- func (c *Cases) SDiffStore() *Case
- func (c *Cases) SInter() *Case
- func (c *Cases) SInterStore() *Case
- func (c *Cases) SIsMember() *Case
- func (c *Cases) SMIsMember() *Case
- func (c *Cases) SMembers() *Case
- func (c *Cases) SMove() *Case
- func (c *Cases) SPop() *Case
- func (c *Cases) SRandMember() *Case
- func (c *Cases) SRem() *Case
- func (c *Cases) SUnion() *Case
- func (c *Cases) SUnionStore() *Case
- func (c *Cases) Set() *Case
- func (c *Cases) SetBit() *Case
- func (c *Cases) SetEX() *Case
- func (c *Cases) SetNX() *Case
- func (c *Cases) SetRange() *Case
- func (c *Cases) StrLen() *Case
- func (c *Cases) TTL() *Case
- func (c *Cases) Touch() *Case
- func (c *Cases) Type() *Case
- func (c *Cases) ZAdd() *Case
- func (c *Cases) ZCard() *Case
- func (c *Cases) ZCount() *Case
- func (c *Cases) ZDiff() *Case
- func (c *Cases) ZIncrBy() *Case
- func (c *Cases) ZInter() *Case
- func (c *Cases) ZLexCount() *Case
- func (c *Cases) ZMScore() *Case
- func (c *Cases) ZPopMax() *Case
- func (c *Cases) ZPopMin() *Case
- func (c *Cases) ZRandMember() *Case
- func (c *Cases) ZRange() *Case
- func (c *Cases) ZRangeByLex() *Case
- func (c *Cases) ZRangeByScore() *Case
- func (c *Cases) ZRank() *Case
- func (c *Cases) ZRem() *Case
- func (c *Cases) ZRemRangeByLex() *Case
- func (c *Cases) ZRemRangeByRank() *Case
- func (c *Cases) ZRemRangeByScore() *Case
- func (c *Cases) ZRevRange() *Case
- func (c *Cases) ZRevRangeByLex() *Case
- func (c *Cases) ZRevRangeByScore() *Case
- func (c *Cases) ZRevRank() *Case
- func (c *Cases) ZScore() *Case
- func (c *Cases) ZUnion() *Case
- func (c *Cases) ZUnionStore() *Case
- type Client
- func (c *Client) Append(ctx context.Context, key, value string) (int64, error)
- func (c *Client) BitCount(ctx context.Context, key string, args ...interface{}) (int64, error)
- func (c *Client) BitOpAnd(ctx context.Context, destKey string, keys ...string) (int64, error)
- func (c *Client) BitOpNot(ctx context.Context, destKey string, key string) (int64, error)
- func (c *Client) BitOpOr(ctx context.Context, destKey string, keys ...string) (int64, error)
- func (c *Client) BitOpXor(ctx context.Context, destKey string, keys ...string) (int64, error)
- func (c *Client) BitPos(ctx context.Context, key string, bit int64, args ...interface{}) (int64, error)
- func (c *Client) Decr(ctx context.Context, key string) (int64, error)
- func (c *Client) DecrBy(ctx context.Context, key string, decrement int64) (int64, error)
- func (c *Client) Del(ctx context.Context, keys ...string) (int64, error)
- func (c *Client) Dump(ctx context.Context, key string) (string, error)
- func (c *Client) Exists(ctx context.Context, keys ...string) (int64, error)
- func (c *Client) Expire(ctx context.Context, key string, expire int64, args ...interface{}) (int64, error)
- func (c *Client) ExpireAt(ctx context.Context, key string, expireAt int64, args ...interface{}) (int64, error)
- func (c *Client) Float(ctx context.Context, args ...interface{}) (float64, error)
- func (c *Client) FloatSlice(ctx context.Context, args ...interface{}) ([]float64, error)
- func (c *Client) FlushAll(ctx context.Context, args ...interface{}) (string, error)
- func (c *Client) Get(ctx context.Context, key string) (string, error)
- func (c *Client) GetBit(ctx context.Context, key string, offset int64) (int64, error)
- func (c *Client) GetDel(ctx context.Context, key string) (string, error)
- func (c *Client) GetEx(ctx context.Context, key string, args ...interface{}) (string, error)
- func (c *Client) GetRange(ctx context.Context, key string, start, end int64) (string, error)
- func (c *Client) GetSet(ctx context.Context, key string, value interface{}) (string, error)
- func (c *Client) HDel(ctx context.Context, key string, fields ...string) (int64, error)
- func (c *Client) HExists(ctx context.Context, key, field string) (int64, error)
- func (c *Client) HGet(ctx context.Context, key string, field string) (string, error)
- func (c *Client) HGetAll(ctx context.Context, key string) (map[string]string, error)
- func (c *Client) HIncrBy(ctx context.Context, key, field string, incr int64) (int64, error)
- func (c *Client) HIncrByFloat(ctx context.Context, key, field string, incr float64) (float64, error)
- func (c *Client) HKeys(ctx context.Context, key string) ([]string, error)
- func (c *Client) HLen(ctx context.Context, key string) (int64, error)
- func (c *Client) HMGet(ctx context.Context, key string, fields ...string) ([]interface{}, error)
- func (c *Client) HSet(ctx context.Context, key string, args ...interface{}) (int64, error)
- func (c *Client) HSetNX(ctx context.Context, key, field string, value interface{}) (int64, error)
- func (c *Client) HStrLen(ctx context.Context, key, field string) (int64, error)
- func (c *Client) HVals(ctx context.Context, key string) ([]string, error)
- func (c *Client) Incr(ctx context.Context, key string) (int64, error)
- func (c *Client) IncrBy(ctx context.Context, key string, value int64) (int64, error)
- func (c *Client) IncrByFloat(ctx context.Context, key string, value float64) (float64, error)
- func (c *Client) Int(ctx context.Context, args ...interface{}) (int64, error)
- func (c *Client) IntSlice(ctx context.Context, args ...interface{}) ([]int64, error)
- func (c *Client) Keys(ctx context.Context, pattern string) ([]string, error)
- func (c *Client) LIndex(ctx context.Context, key string, index int64) (string, error)
- func (c *Client) LInsertAfter(ctx context.Context, key string, pivot, value interface{}) (int64, error)
- func (c *Client) LInsertBefore(ctx context.Context, key string, pivot, value interface{}) (int64, error)
- func (c *Client) LLen(ctx context.Context, key string) (int64, error)
- func (c *Client) LMove(ctx context.Context, source, destination, srcPos, destPos string) (string, error)
- func (c *Client) LPop(ctx context.Context, key string) (string, error)
- func (c *Client) LPopN(ctx context.Context, key string, count int) ([]string, error)
- func (c *Client) LPos(ctx context.Context, key string, value interface{}, args ...interface{}) (int64, error)
- func (c *Client) LPosN(ctx context.Context, key string, value interface{}, count int64, ...) ([]int64, error)
- func (c *Client) LPush(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (c *Client) LPushX(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (c *Client) LRange(ctx context.Context, key string, start, stop int64) ([]string, error)
- func (c *Client) LRem(ctx context.Context, key string, count int64, value interface{}) (int64, error)
- func (c *Client) LSet(ctx context.Context, key string, index int64, value interface{}) (string, error)
- func (c *Client) LTrim(ctx context.Context, key string, start, stop int64) (string, error)
- func (c *Client) MGet(ctx context.Context, keys ...string) ([]interface{}, error)
- func (c *Client) MSet(ctx context.Context, args ...interface{}) (string, error)
- func (c *Client) MSetNX(ctx context.Context, args ...interface{}) (int64, error)
- func (c *Client) PExpire(ctx context.Context, key string, expire int64, args ...interface{}) (int64, error)
- func (c *Client) PExpireAt(ctx context.Context, key string, expireAt int64, args ...interface{}) (int64, error)
- func (c *Client) PSetEX(ctx context.Context, key string, value interface{}, expire int64) (string, error)
- func (c *Client) PTTL(ctx context.Context, key string) (int64, error)
- func (c *Client) Persist(ctx context.Context, key string) (int64, error)
- func (c *Client) RPop(ctx context.Context, key string) (string, error)
- func (c *Client) RPopLPush(ctx context.Context, source, destination string) (string, error)
- func (c *Client) RPopN(ctx context.Context, key string, count int) ([]string, error)
- func (c *Client) RPush(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (c *Client) RPushX(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (c *Client) RandomKey(ctx context.Context) (string, error)
- func (c *Client) Rename(ctx context.Context, key, newKey string) (string, error)
- func (c *Client) RenameNX(ctx context.Context, key, newKey string) (int64, error)
- func (c *Client) SAdd(ctx context.Context, key string, members ...interface{}) (int64, error)
- func (c *Client) SCard(ctx context.Context, key string) (int64, error)
- func (c *Client) SDiff(ctx context.Context, keys ...string) ([]string, error)
- func (c *Client) SDiffStore(ctx context.Context, destination string, keys ...string) (int64, error)
- func (c *Client) SInter(ctx context.Context, keys ...string) ([]string, error)
- func (c *Client) SInterStore(ctx context.Context, destination string, keys ...string) (int64, error)
- func (c *Client) SIsMember(ctx context.Context, key string, member interface{}) (int64, error)
- func (c *Client) SMIsMember(ctx context.Context, key string, members ...interface{}) ([]int64, error)
- func (c *Client) SMembers(ctx context.Context, key string) ([]string, error)
- func (c *Client) SMove(ctx context.Context, source, destination string, member interface{}) (int64, error)
- func (c *Client) SPop(ctx context.Context, key string) (string, error)
- func (c *Client) SPopN(ctx context.Context, key string, count int64) ([]string, error)
- func (c *Client) SRandMember(ctx context.Context, key string) (string, error)
- func (c *Client) SRandMemberN(ctx context.Context, key string, count int64) ([]string, error)
- func (c *Client) SRem(ctx context.Context, key string, members ...interface{}) (int64, error)
- func (c *Client) SUnion(ctx context.Context, keys ...string) ([]string, error)
- func (c *Client) SUnionStore(ctx context.Context, destination string, keys ...string) (int64, error)
- func (c *Client) Set(ctx context.Context, key string, value interface{}, args ...interface{}) (string, error)
- func (c *Client) SetBit(ctx context.Context, key string, offset int64, value int) (int64, error)
- func (c *Client) SetEX(ctx context.Context, key string, value interface{}, expire int64) (string, error)
- func (c *Client) SetNX(ctx context.Context, key string, value interface{}) (int64, error)
- func (c *Client) SetRange(ctx context.Context, key string, offset int64, value string) (int64, error)
- func (c *Client) Slice(ctx context.Context, args ...interface{}) ([]interface{}, error)
- func (c *Client) StrLen(ctx context.Context, key string) (int64, error)
- func (c *Client) String(ctx context.Context, args ...interface{}) (string, error)
- func (c *Client) StringMap(ctx context.Context, args ...interface{}) (map[string]string, error)
- func (c *Client) StringSlice(ctx context.Context, args ...interface{}) ([]string, error)
- func (c *Client) TTL(ctx context.Context, key string) (int64, error)
- func (c *Client) Touch(ctx context.Context, keys ...string) (int64, error)
- func (c *Client) Type(ctx context.Context, key string) (string, error)
- func (c *Client) ZAdd(ctx context.Context, key string, args ...interface{}) (int64, error)
- func (c *Client) ZCard(ctx context.Context, key string) (int64, error)
- func (c *Client) ZCount(ctx context.Context, key, min, max string) (int64, error)
- func (c *Client) ZDiff(ctx context.Context, keys ...string) ([]string, error)
- func (c *Client) ZDiffWithScores(ctx context.Context, keys ...string) ([]ZItem, error)
- func (c *Client) ZIncrBy(ctx context.Context, key string, increment float64, member string) (float64, error)
- func (c *Client) ZInter(ctx context.Context, args ...interface{}) ([]string, error)
- func (c *Client) ZInterWithScores(ctx context.Context, args ...interface{}) ([]ZItem, error)
- func (c *Client) ZItemSlice(ctx context.Context, args ...interface{}) ([]ZItem, error)
- func (c *Client) ZLexCount(ctx context.Context, key, min, max string) (int64, error)
- func (c *Client) ZMScore(ctx context.Context, key string, members ...string) ([]float64, error)
- func (c *Client) ZPopMax(ctx context.Context, key string) ([]ZItem, error)
- func (c *Client) ZPopMaxN(ctx context.Context, key string, count int64) ([]ZItem, error)
- func (c *Client) ZPopMin(ctx context.Context, key string) ([]ZItem, error)
- func (c *Client) ZPopMinN(ctx context.Context, key string, count int64) ([]ZItem, error)
- func (c *Client) ZRandMember(ctx context.Context, key string) (string, error)
- func (c *Client) ZRandMemberN(ctx context.Context, key string, count int) ([]string, error)
- func (c *Client) ZRandMemberWithScores(ctx context.Context, key string, count int) ([]ZItem, error)
- func (c *Client) ZRange(ctx context.Context, key string, start, stop int64, args ...interface{}) ([]string, error)
- func (c *Client) ZRangeByLex(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)
- func (c *Client) ZRangeByScore(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)
- func (c *Client) ZRangeWithScores(ctx context.Context, key string, start, stop int64, args ...interface{}) ([]ZItem, error)
- func (c *Client) ZRank(ctx context.Context, key, member string) (int64, error)
- func (c *Client) ZRem(ctx context.Context, key string, members ...interface{}) (int64, error)
- func (c *Client) ZRemRangeByLex(ctx context.Context, key, min, max string) (int64, error)
- func (c *Client) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (int64, error)
- func (c *Client) ZRemRangeByScore(ctx context.Context, key, min, max string) (int64, error)
- func (c *Client) ZRevRange(ctx context.Context, key string, start, stop int64) ([]string, error)
- func (c *Client) ZRevRangeByLex(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)
- func (c *Client) ZRevRangeByScore(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)
- func (c *Client) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]string, error)
- func (c *Client) ZRevRank(ctx context.Context, key, member string) (int64, error)
- func (c *Client) ZScore(ctx context.Context, key, member string) (float64, error)
- func (c *Client) ZUnion(ctx context.Context, args ...interface{}) ([]string, error)
- func (c *Client) ZUnionStore(ctx context.Context, dest string, args ...interface{}) (int64, error)
- func (c *Client) ZUnionWithScores(ctx context.Context, args ...interface{}) ([]ZItem, error)
- type Config
- type Driver
- type MockDriver
- type MockDriverMockRecorder
- type Result
- type ZItem
Constants ¶
This section is empty.
Variables ¶
var ( Recorder func(Driver) Driver Replayer func(Driver) Driver )
Functions ¶
Types ¶
type Cases ¶
type Cases struct{}
func (*Cases) HIncrByFloat ¶
func (*Cases) IncrByFloat ¶
func (*Cases) SDiffStore ¶
func (*Cases) SInterStore ¶
func (*Cases) SMIsMember ¶
func (*Cases) SRandMember ¶
func (*Cases) SUnionStore ¶
func (*Cases) ZRandMember ¶
func (*Cases) ZRangeByLex ¶
func (*Cases) ZRangeByScore ¶
func (*Cases) ZRemRangeByLex ¶
func (*Cases) ZRemRangeByRank ¶
func (*Cases) ZRemRangeByScore ¶
func (*Cases) ZRevRangeByLex ¶
func (*Cases) ZRevRangeByScore ¶
func (*Cases) ZUnionStore ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides operations for redis commands.
func (*Client) Append ¶
Append https://redis.io/commands/append Command: APPEND key value Integer reply: the length of the string after the append operation.
func (*Client) BitCount ¶
BitCount https://redis.io/commands/bitcount Command: BITCOUNT key [start end] Integer reply: The number of bits set to 1.
func (*Client) BitOpAnd ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
Decr https://redis.io/commands/decr Command: DECR key Integer reply: the value of key after the decrement
func (*Client) DecrBy ¶
DecrBy https://redis.io/commands/decrby Command: DECRBY key decrement Integer reply: the value of key after the decrement.
func (*Client) Del ¶
Del https://redis.io/commands/del Command: DEL key [key ...] Integer reply: The number of keys that were removed.
func (*Client) Dump ¶
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 ¶
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 ¶
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 ¶
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) FloatSlice ¶
FloatSlice executes a command whose reply is a `[]float64`.
func (*Client) FlushAll ¶
FlushAll https://redis.io/commands/flushall Command: FLUSHALL [ASYNC|SYNC] Simple string reply
func (*Client) Get ¶
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 ¶
GetBit https://redis.io/commands/getbit Command: GETBIT key offset Integer reply: the bit value stored at offset.
func (*Client) GetDel ¶
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 ¶
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 ¶
GetRange https://redis.io/commands/getrange Command: GETRANGE key start end Bulk string reply
func (*Client) GetSet ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
HIncrBy https://redis.io/commands/hincrby Command: HINCRBY key field increment Integer reply: the value at field after the increment operation.
func (*Client) HIncrByFloat ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
Incr https://redis.io/commands/incr Command: INCR key Integer reply: the value of key after the increment
func (*Client) IncrBy ¶
IncrBy https://redis.io/commands/incrby Command: INCRBY key increment Integer reply: the value of key after the increment.
func (*Client) IncrByFloat ¶
IncrByFloat https://redis.io/commands/incrbyfloat Command: INCRBYFLOAT key increment Bulk string reply: the value of key after the increment.
func (*Client) Keys ¶
Keys https://redis.io/commands/keys Command: KEYS pattern Array reply: list of keys matching pattern.
func (*Client) LIndex ¶
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 ¶
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 ¶
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 ¶
LLen https://redis.io/commands/llen Command: LLEN key Integer reply: the length of the list at key.
func (*Client) LMove ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
LRange https://redis.io/commands/lrange Command: LRANGE key start stop Array reply: list of elements in the specified range.
func (*Client) LRem ¶
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 ¶
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 ¶
LTrim https://redis.io/commands/ltrim Command: LTRIM key start stop Simple string reply
func (*Client) MGet ¶
MGet https://redis.io/commands/mget Command: MGET key [key ...] Array reply: list of values at the specified keys.
func (*Client) MSet ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
RPopLPush https://redis.io/commands/rpoplpush Command: RPOPLPUSH source destination Bulk string reply: the element being popped and pushed.
func (*Client) RPopN ¶
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 ¶
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 ¶
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 ¶
RandomKey https://redis.io/commands/randomkey Command: RANDOMKEY Bulk string reply: the random key, or nil when the database is empty.
func (*Client) Rename ¶
Rename https://redis.io/commands/rename Command: RENAME key newkey Simple string reply.
func (*Client) RenameNX ¶
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 ¶
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 ¶
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 ¶
SDiff https://redis.io/commands/sdiff Command: SDIFF key [key ...] Array reply: list with members of the resulting set.
func (*Client) SDiffStore ¶
SDiffStore https://redis.io/commands/sdiffstore Command: SDIFFSTORE destination key [key ...] Integer reply: the number of elements in the resulting set.
func (*Client) SInter ¶
SInter https://redis.io/commands/sinter Command: SINTER key [key ...] Array reply: list with members of the resulting set.
func (*Client) SInterStore ¶
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 ¶
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 ¶
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 ¶
SMembers https://redis.io/commands/smembers Command: SMEMBERS key Array reply: all elements of the set.
func (*Client) SMove ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
SUnion https://redis.io/commands/sunion Command: SUNION key [key ...] Array reply: list with members of the resulting set.
func (*Client) SUnionStore ¶
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 ¶
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 ¶
SetBit https://redis.io/commands/setbit Command: SETBIT key offset value Integer reply: the original bit value stored at offset.
func (*Client) SetEX ¶
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 ¶
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 ¶
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) StrLen ¶
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) StringSlice ¶
StringSlice executes a command whose reply is a `[]string`.
func (*Client) TTL ¶
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 ¶
Touch https://redis.io/commands/touch Command: TOUCH key [key ...] Integer reply: The number of keys that were touched.
func (*Client) Type ¶
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 ¶
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 ¶
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 ¶
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 ¶
ZDiff https://redis.io/commands/zdiff Command: ZDIFF numkeys key [key ...] [WITHSCORES] Array reply: the result of the difference.
func (*Client) ZDiffWithScores ¶
ZDiffWithScores https://redis.io/commands/zdiff Command: ZDIFF numkeys key [key ...] [WITHSCORES] Array reply: the result of the difference.
func (*Client) ZIncrBy ¶
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 ¶
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 ¶
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 ¶
ZItemSlice executes a command whose reply is a `[]ZItem`.
func (*Client) ZLexCount ¶
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 ¶
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 ¶
ZPopMax https://redis.io/commands/zpopmax Command: ZPOPMAX key [count] Array reply: list of popped elements and scores.
func (*Client) ZPopMaxN ¶
ZPopMaxN https://redis.io/commands/zpopmax Command: ZPOPMAX key [count] Array reply: list of popped elements and scores.
func (*Client) ZPopMin ¶
ZPopMin https://redis.io/commands/zpopmin Command: ZPOPMIN key [count] Array reply: list of popped elements and scores.
func (*Client) ZPopMinN ¶
ZPopMinN https://redis.io/commands/zpopmin Command: ZPOPMIN key [count] Array reply: list of popped elements and scores.
func (*Client) ZRandMember ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
ZRemRangeByLex https://redis.io/commands/zremrangebylex Command: ZREMRANGEBYLEX key min max Integer reply: the number of elements removed.
func (*Client) ZRemRangeByRank ¶
ZRemRangeByRank https://redis.io/commands/zremrangebyrank Command: ZREMRANGEBYRANK key start stop Integer reply: the number of elements removed.
func (*Client) ZRemRangeByScore ¶
ZRemRangeByScore https://redis.io/commands/zremrangebyscore Command: ZREMRANGEBYSCORE key min max Integer reply: the number of elements removed.
func (*Client) ZRevRange ¶
ZRevRange https://redis.io/commands/zrevrange Command: ZREVRANGE key start stop [WITHSCORES] Array reply: list of elements in the specified range.
func (*Client) ZRevRangeByLex ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 MockDriver ¶
type MockDriver struct {
// contains filtered or unexported fields
}
MockDriver is a mock of Driver interface.
func NewMockDriver ¶
func NewMockDriver(ctrl *gomock.Controller) *MockDriver
NewMockDriver creates a new mock instance.
func (*MockDriver) EXPECT ¶
func (m *MockDriver) EXPECT() *MockDriverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDriverMockRecorder ¶
type MockDriverMockRecorder struct {
// contains filtered or unexported fields
}
MockDriverMockRecorder is the mock recorder for MockDriver.
func (*MockDriverMockRecorder) Exec ¶
func (mr *MockDriverMockRecorder) Exec(ctx, args interface{}) *gomock.Call
Exec indicates an expected call of Exec.