Documentation
¶
Index ¶
- Constants
- Variables
- type BaseClient
- func (c *BaseClient) Append(ctx context.Context, key, value string) (int64, error)
- func (c *BaseClient) BitCount(ctx context.Context, key string, args ...interface{}) (int64, error)
- func (c *BaseClient) BitOpAnd(ctx context.Context, destKey string, keys ...string) (int64, error)
- func (c *BaseClient) BitOpNot(ctx context.Context, destKey string, key string) (int64, error)
- func (c *BaseClient) BitOpOr(ctx context.Context, destKey string, keys ...string) (int64, error)
- func (c *BaseClient) BitOpXor(ctx context.Context, destKey string, keys ...string) (int64, error)
- func (c *BaseClient) BitPos(ctx context.Context, key string, bit int64, args ...interface{}) (int64, error)
- func (c *BaseClient) Bool(ctx context.Context, args ...interface{}) (bool, error)
- func (c *BaseClient) BoolSlice(ctx context.Context, args ...interface{}) ([]bool, error)
- func (c *BaseClient) Decr(ctx context.Context, key string) (int64, error)
- func (c *BaseClient) DecrBy(ctx context.Context, key string, decrement int64) (int64, error)
- func (c *BaseClient) Del(ctx context.Context, keys ...string) (int64, error)
- func (c *BaseClient) Dump(ctx context.Context, key string) (string, error)
- func (c *BaseClient) Exists(ctx context.Context, keys ...string) (int64, error)
- func (c *BaseClient) Expire(ctx context.Context, key string, expire int64, args ...interface{}) (bool, error)
- func (c *BaseClient) ExpireAt(ctx context.Context, key string, expireAt int64, args ...interface{}) (bool, error)
- func (c *BaseClient) Float64(ctx context.Context, args ...interface{}) (float64, error)
- func (c *BaseClient) Float64Slice(ctx context.Context, args ...interface{}) ([]float64, error)
- func (c *BaseClient) FlushAll(ctx context.Context, args ...interface{}) (string, error)
- func (c *BaseClient) Get(ctx context.Context, key string) (string, error)
- func (c *BaseClient) GetBit(ctx context.Context, key string, offset int64) (int64, error)
- func (c *BaseClient) GetDel(ctx context.Context, key string) (string, error)
- func (c *BaseClient) GetEx(ctx context.Context, key string, args ...interface{}) (string, error)
- func (c *BaseClient) GetRange(ctx context.Context, key string, start, end int64) (string, error)
- func (c *BaseClient) GetSet(ctx context.Context, key string, value interface{}) (string, error)
- func (c *BaseClient) HDel(ctx context.Context, key string, fields ...string) (int64, error)
- func (c *BaseClient) HExists(ctx context.Context, key, field string) (bool, error)
- func (c *BaseClient) HGet(ctx context.Context, key string, field string) (string, error)
- func (c *BaseClient) HGetAll(ctx context.Context, key string) (map[string]string, error)
- func (c *BaseClient) HIncrBy(ctx context.Context, key, field string, incr int64) (int64, error)
- func (c *BaseClient) HIncrByFloat(ctx context.Context, key, field string, incr float64) (float64, error)
- func (c *BaseClient) HKeys(ctx context.Context, key string) ([]string, error)
- func (c *BaseClient) HLen(ctx context.Context, key string) (int64, error)
- func (c *BaseClient) HMGet(ctx context.Context, key string, fields ...string) ([]interface{}, error)
- func (c *BaseClient) HSet(ctx context.Context, key string, args ...interface{}) (int64, error)
- func (c *BaseClient) HSetNX(ctx context.Context, key, field string, value interface{}) (bool, error)
- func (c *BaseClient) HStrLen(ctx context.Context, key, field string) (int64, error)
- func (c *BaseClient) HVals(ctx context.Context, key string) ([]string, error)
- func (c *BaseClient) Incr(ctx context.Context, key string) (int64, error)
- func (c *BaseClient) IncrBy(ctx context.Context, key string, value int64) (int64, error)
- func (c *BaseClient) IncrByFloat(ctx context.Context, key string, value float64) (float64, error)
- func (c *BaseClient) Int64(ctx context.Context, args ...interface{}) (int64, error)
- func (c *BaseClient) Int64Slice(ctx context.Context, args ...interface{}) ([]int64, error)
- func (c *BaseClient) Keys(ctx context.Context, pattern string) ([]string, error)
- func (c *BaseClient) LIndex(ctx context.Context, key string, index int64) (string, error)
- func (c *BaseClient) LInsertAfter(ctx context.Context, key string, pivot, value interface{}) (int64, error)
- func (c *BaseClient) LInsertBefore(ctx context.Context, key string, pivot, value interface{}) (int64, error)
- func (c *BaseClient) LLen(ctx context.Context, key string) (int64, error)
- func (c *BaseClient) LMove(ctx context.Context, source, destination, srcPos, destPos string) (string, error)
- func (c *BaseClient) LPop(ctx context.Context, key string) (string, error)
- func (c *BaseClient) LPopN(ctx context.Context, key string, count int) ([]string, error)
- func (c *BaseClient) LPos(ctx context.Context, key string, value interface{}, args ...interface{}) (int64, error)
- func (c *BaseClient) LPosN(ctx context.Context, key string, value interface{}, count int64, ...) ([]int64, error)
- func (c *BaseClient) LPush(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (c *BaseClient) LPushX(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (c *BaseClient) LRange(ctx context.Context, key string, start, stop int64) ([]string, error)
- func (c *BaseClient) LRem(ctx context.Context, key string, count int64, value interface{}) (int64, error)
- func (c *BaseClient) LSet(ctx context.Context, key string, index int64, value interface{}) (bool, error)
- func (c *BaseClient) LTrim(ctx context.Context, key string, start, stop int64) (bool, error)
- func (c *BaseClient) MGet(ctx context.Context, keys ...string) ([]interface{}, error)
- func (c *BaseClient) MSet(ctx context.Context, args ...interface{}) (bool, error)
- func (c *BaseClient) MSetNX(ctx context.Context, args ...interface{}) (bool, error)
- func (c *BaseClient) PExpire(ctx context.Context, key string, expire int64, args ...interface{}) (bool, error)
- func (c *BaseClient) PExpireAt(ctx context.Context, key string, expireAt int64, args ...interface{}) (bool, error)
- func (c *BaseClient) PSetEX(ctx context.Context, key string, value interface{}, expire int64) (bool, error)
- func (c *BaseClient) PTTL(ctx context.Context, key string) (int64, error)
- func (c *BaseClient) Persist(ctx context.Context, key string) (bool, error)
- func (c *BaseClient) RPop(ctx context.Context, key string) (string, error)
- func (c *BaseClient) RPopLPush(ctx context.Context, source, destination string) (string, error)
- func (c *BaseClient) RPopN(ctx context.Context, key string, count int) ([]string, error)
- func (c *BaseClient) RPush(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (c *BaseClient) RPushX(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (c *BaseClient) RandomKey(ctx context.Context) (string, error)
- func (c *BaseClient) Rename(ctx context.Context, key, newKey string) (bool, error)
- func (c *BaseClient) RenameNX(ctx context.Context, key, newKey string) (bool, error)
- func (c *BaseClient) SAdd(ctx context.Context, key string, members ...interface{}) (int64, error)
- func (c *BaseClient) SCard(ctx context.Context, key string) (int64, error)
- func (c *BaseClient) SDiff(ctx context.Context, keys ...string) ([]string, error)
- func (c *BaseClient) SDiffStore(ctx context.Context, destination string, keys ...string) (int64, error)
- func (c *BaseClient) SInter(ctx context.Context, keys ...string) ([]string, error)
- func (c *BaseClient) SInterStore(ctx context.Context, destination string, keys ...string) (int64, error)
- func (c *BaseClient) SIsMember(ctx context.Context, key string, member interface{}) (bool, error)
- func (c *BaseClient) SMIsMember(ctx context.Context, key string, members ...interface{}) ([]bool, error)
- func (c *BaseClient) SMembers(ctx context.Context, key string) ([]string, error)
- func (c *BaseClient) SMove(ctx context.Context, source, destination string, member interface{}) (bool, error)
- func (c *BaseClient) SPop(ctx context.Context, key string) (string, error)
- func (c *BaseClient) SPopN(ctx context.Context, key string, count int64) ([]string, error)
- func (c *BaseClient) SRandMember(ctx context.Context, key string) (string, error)
- func (c *BaseClient) SRandMemberN(ctx context.Context, key string, count int64) ([]string, error)
- func (c *BaseClient) SRem(ctx context.Context, key string, members ...interface{}) (int64, error)
- func (c *BaseClient) SUnion(ctx context.Context, keys ...string) ([]string, error)
- func (c *BaseClient) SUnionStore(ctx context.Context, destination string, keys ...string) (int64, error)
- func (c *BaseClient) Set(ctx context.Context, key string, value interface{}, args ...interface{}) (bool, error)
- func (c *BaseClient) SetBit(ctx context.Context, key string, offset int64, value int) (int64, error)
- func (c *BaseClient) SetEX(ctx context.Context, key string, value interface{}, expire int64) (bool, error)
- func (c *BaseClient) SetNX(ctx context.Context, key string, value interface{}) (bool, error)
- func (c *BaseClient) SetRange(ctx context.Context, key string, offset int64, value string) (int64, error)
- func (c *BaseClient) Slice(ctx context.Context, args ...interface{}) ([]interface{}, error)
- func (c *BaseClient) StrLen(ctx context.Context, key string) (int64, error)
- func (c *BaseClient) String(ctx context.Context, args ...interface{}) (string, error)
- func (c *BaseClient) StringMap(ctx context.Context, args ...interface{}) (map[string]string, error)
- func (c *BaseClient) StringSlice(ctx context.Context, args ...interface{}) ([]string, error)
- func (c *BaseClient) TTL(ctx context.Context, key string) (int64, error)
- func (c *BaseClient) Touch(ctx context.Context, keys ...string) (int64, error)
- func (c *BaseClient) Type(ctx context.Context, key string) (string, error)
- func (c *BaseClient) ZAdd(ctx context.Context, key string, args ...interface{}) (int64, error)
- func (c *BaseClient) ZCard(ctx context.Context, key string) (int64, error)
- func (c *BaseClient) ZCount(ctx context.Context, key, min, max string) (int64, error)
- func (c *BaseClient) ZDiff(ctx context.Context, keys ...string) ([]string, error)
- func (c *BaseClient) ZDiffWithScores(ctx context.Context, keys ...string) ([]ZItem, error)
- func (c *BaseClient) ZIncrBy(ctx context.Context, key string, increment float64, member string) (float64, error)
- func (c *BaseClient) ZInter(ctx context.Context, args ...interface{}) ([]string, error)
- func (c *BaseClient) ZInterWithScores(ctx context.Context, args ...interface{}) ([]ZItem, error)
- func (c *BaseClient) ZItemSlice(ctx context.Context, args ...interface{}) ([]ZItem, error)
- func (c *BaseClient) ZLexCount(ctx context.Context, key, min, max string) (int64, error)
- func (c *BaseClient) ZMScore(ctx context.Context, key string, members ...string) ([]float64, error)
- func (c *BaseClient) ZPopMax(ctx context.Context, key string) ([]ZItem, error)
- func (c *BaseClient) ZPopMaxN(ctx context.Context, key string, count int64) ([]ZItem, error)
- func (c *BaseClient) ZPopMin(ctx context.Context, key string) ([]ZItem, error)
- func (c *BaseClient) ZPopMinN(ctx context.Context, key string, count int64) ([]ZItem, error)
- func (c *BaseClient) ZRandMember(ctx context.Context, key string) (string, error)
- func (c *BaseClient) ZRandMemberN(ctx context.Context, key string, count int) ([]string, error)
- func (c *BaseClient) ZRandMemberWithScores(ctx context.Context, key string, count int) ([]ZItem, error)
- func (c *BaseClient) ZRange(ctx context.Context, key string, start, stop int64, args ...interface{}) ([]string, error)
- func (c *BaseClient) ZRangeByLex(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)
- func (c *BaseClient) ZRangeByScore(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)
- func (c *BaseClient) ZRangeWithScores(ctx context.Context, key string, start, stop int64, args ...interface{}) ([]ZItem, error)
- func (c *BaseClient) ZRank(ctx context.Context, key, member string) (int64, error)
- func (c *BaseClient) ZRem(ctx context.Context, key string, members ...interface{}) (int64, error)
- func (c *BaseClient) ZRemRangeByLex(ctx context.Context, key, min, max string) (int64, error)
- func (c *BaseClient) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (int64, error)
- func (c *BaseClient) ZRemRangeByScore(ctx context.Context, key, min, max string) (int64, error)
- func (c *BaseClient) ZRevRange(ctx context.Context, key string, start, stop int64) ([]string, error)
- func (c *BaseClient) ZRevRangeByLex(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)
- func (c *BaseClient) ZRevRangeByScore(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, error)
- func (c *BaseClient) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]string, error)
- func (c *BaseClient) ZRevRank(ctx context.Context, key, member string) (int64, error)
- func (c *BaseClient) ZScore(ctx context.Context, key, member string) (float64, error)
- func (c *BaseClient) ZUnion(ctx context.Context, args ...interface{}) ([]string, error)
- func (c *BaseClient) ZUnionStore(ctx context.Context, dest string, args ...interface{}) (int64, error)
- func (c *BaseClient) ZUnionWithScores(ctx context.Context, args ...interface{}) ([]ZItem, error)
- type BaseCommand
- type BitmapCommand
- type Client
- type HashCommand
- type KeyCommand
- type ListCommand
- type Reply
- type ServerCommand
- type SetCommand
- type StringCommand
- type ZItem
- type ZSetCommand
Constants ¶
View Source
const ( CommandBitCount = "BITCOUNT" CommandBitOp = "BITOP" CommandBitPos = "BITPOS" CommandGetBit = "GETBIT" CommandSetBit = "SETBIT" )
View Source
const ( CommandHDel = "HDEL" CommandHExists = "HEXISTS" CommandHGet = "HGET" CommandHGetAll = "HGETALL" CommandHIncrBy = "HINCRBY" CommandHIncrByFloat = "HINCRBYFLOAT" CommandHKeys = "HKEYS" CommandHLen = "HLEN" CommandHMGet = "HMGET" CommandHSet = "HSET" CommandHSetNX = "HSETNX" CommandHStrLen = "HSTRLEN" CommandHVals = "HVALS" )
View Source
const ( CommandDel = "DEL" CommandDump = "DUMP" CommandExists = "EXISTS" CommandExpire = "EXPIRE" CommandExpireAt = "EXPIREAT" CommandKeys = "KEYS" CommandPersist = "PERSIST" CommandPExpire = "PEXPIRE" CommandPExpireAt = "PEXPIREAT" CommandPTTL = "PTTL" CommandRandomKey = "RANDOMKEY" CommandRename = "RENAME" CommandRenameNX = "RENAMENX" CommandTouch = "TOUCH" CommandTTL = "TTL" CommandType = "TYPE" )
View Source
const ( CommandLIndex = "LINDEX" CommandLInsert = "LINSERT" CommandLLen = "LLEN" CommandLMove = "LMOVE" CommandLPop = "LPOP" CommandLPos = "LPOS" CommandLPush = "LPUSH" CommandLPushX = "LPUSHX" CommandLRange = "LRANGE" CommandLRem = "LREM" CommandLSet = "LSET" CommandLTrim = "LTRIM" CommandRPop = "RPOP" CommandRPopLPush = "RPOPLPUSH" CommandRPush = "RPUSH" CommandRPushX = "RPUSHX" )
View Source
const ( CommandSAdd = "SADD" CommandSCard = "SCARD" CommandSDiff = "SDIFF" CommandSDiffStore = "SDIFFSTORE" CommandSInter = "SINTER" CommandSInterStore = "SINTERSTORE" CommandSIsMember = "SISMEMBER" CommandSMIsMember = "SMISMEMBER" CommandSMembers = "SMEMBERS" CommandSMove = "SMOVE" CommandSPop = "SPOP" CommandSRandMember = "SRANDMEMBER" CommandSRem = "SREM" CommandSUnion = "SUNION" CommandSUnionStore = "SUNIONSTORE" )
View Source
const ( CommandAppend = "APPEND" CommandDecr = "DECR" CommandDecrBy = "DECRBY" CommandGet = "GET" CommandGetDel = "GETDEL" CommandGetEx = "GETEX" CommandGetRange = "GETRANGE" CommandGetSet = "GETSET" CommandIncr = "INCR" CommandIncrBy = "INCRBY" CommandIncrByFloat = "INCRBYFLOAT" CommandMGet = "MGET" CommandMSet = "MSET" CommandMSetNX = "MSETNX" CommandPSetEX = "PSETEX" CommandSet = "SET" CommandSetEX = "SETEX" CommandSetNX = "SETNX" CommandSetRange = "SETRANGE" CommandStrLen = "STRLEN" )
View Source
const ( CommandZAdd = "ZADD" CommandZCard = "ZCARD" CommandZCount = "ZCOUNT" CommandZDiff = "ZDIFF" CommandZIncrBy = "ZINCRBY" CommandZInter = "ZINTER" CommandZLexCount = "ZLEXCOUNT" CommandZMScore = "ZMSCORE" CommandZPopMax = "ZPOPMAX" CommandZPopMin = "ZPOPMIN" CommandZRandMember = "ZRANDMEMBER" CommandZRange = "ZRANGE" CommandZRangeByLex = "ZRANGEBYLEX" CommandZRangeByScore = "ZRANGEBYSCORE" CommandZRank = "ZRANK" CommandZRem = "ZREM" CommandZRemRangeByLex = "ZREMRANGEBYLEX" CommandZRemRangeByRank = "ZREMRANGEBYRANK" CommandZRemRangeByScore = "ZREMRANGEBYSCORE" CommandZRevRange = "ZREVRANGE" CommandZRevRangeByLex = "ZREVRANGEBYLEX" CommandZRevRangeByScore = "ZREVRANGEBYSCORE" CommandZRevRank = "ZREVRANK" CommandZScore = "ZSCORE" CommandZUnion = "ZUNION" CommandZUnionStore = "ZUNIONSTORE" )
View Source
const (
CommandFlushAll = "FLUSHALL"
)
Variables ¶
View Source
var ErrNil = errors.New("redis: nil")
Functions ¶
This section is empty.
Types ¶
type BaseClient ¶
func (*BaseClient) Bool ¶
func (c *BaseClient) Bool(ctx context.Context, args ...interface{}) (bool, error)
func (*BaseClient) BoolSlice ¶
func (c *BaseClient) BoolSlice(ctx context.Context, args ...interface{}) ([]bool, error)
func (*BaseClient) Float64 ¶
func (c *BaseClient) Float64(ctx context.Context, args ...interface{}) (float64, error)
func (*BaseClient) Float64Slice ¶
func (c *BaseClient) Float64Slice(ctx context.Context, args ...interface{}) ([]float64, error)
func (*BaseClient) FlushAll ¶
func (c *BaseClient) FlushAll(ctx context.Context, args ...interface{}) (string, error)
func (*BaseClient) HIncrByFloat ¶
func (*BaseClient) IncrByFloat ¶
func (*BaseClient) Int64 ¶
func (c *BaseClient) Int64(ctx context.Context, args ...interface{}) (int64, error)
func (*BaseClient) Int64Slice ¶
func (c *BaseClient) Int64Slice(ctx context.Context, args ...interface{}) ([]int64, error)
func (*BaseClient) LInsertAfter ¶
func (*BaseClient) LInsertBefore ¶
func (*BaseClient) MGet ¶
func (c *BaseClient) MGet(ctx context.Context, keys ...string) ([]interface{}, error)
func (*BaseClient) MSet ¶
func (c *BaseClient) MSet(ctx context.Context, args ...interface{}) (bool, error)
func (*BaseClient) MSetNX ¶
func (c *BaseClient) MSetNX(ctx context.Context, args ...interface{}) (bool, error)
func (*BaseClient) SDiffStore ¶
func (*BaseClient) SInterStore ¶
func (*BaseClient) SMIsMember ¶
func (*BaseClient) SRandMember ¶
func (*BaseClient) SRandMemberN ¶
func (*BaseClient) SUnionStore ¶
func (*BaseClient) Slice ¶
func (c *BaseClient) Slice(ctx context.Context, args ...interface{}) ([]interface{}, error)
func (*BaseClient) String ¶
func (c *BaseClient) String(ctx context.Context, args ...interface{}) (string, error)
func (*BaseClient) StringSlice ¶
func (c *BaseClient) StringSlice(ctx context.Context, args ...interface{}) ([]string, error)
func (*BaseClient) ZDiffWithScores ¶
func (*BaseClient) ZInter ¶
func (c *BaseClient) ZInter(ctx context.Context, args ...interface{}) ([]string, error)
func (*BaseClient) ZInterWithScores ¶
func (c *BaseClient) ZInterWithScores(ctx context.Context, args ...interface{}) ([]ZItem, error)
func (*BaseClient) ZItemSlice ¶
func (c *BaseClient) ZItemSlice(ctx context.Context, args ...interface{}) ([]ZItem, error)
func (*BaseClient) ZRandMember ¶
func (*BaseClient) ZRandMemberN ¶
func (*BaseClient) ZRandMemberWithScores ¶
func (*BaseClient) ZRangeByLex ¶
func (*BaseClient) ZRangeByScore ¶
func (*BaseClient) ZRangeWithScores ¶
func (*BaseClient) ZRemRangeByLex ¶
func (*BaseClient) ZRemRangeByRank ¶
func (*BaseClient) ZRemRangeByScore ¶
func (*BaseClient) ZRevRangeByLex ¶
func (*BaseClient) ZRevRangeByScore ¶
func (*BaseClient) ZRevRangeWithScores ¶
func (*BaseClient) ZUnion ¶
func (c *BaseClient) ZUnion(ctx context.Context, args ...interface{}) ([]string, error)
func (*BaseClient) ZUnionStore ¶
func (*BaseClient) ZUnionWithScores ¶
func (c *BaseClient) ZUnionWithScores(ctx context.Context, args ...interface{}) ([]ZItem, error)
type BaseCommand ¶
type BaseCommand interface { Bool(ctx context.Context, args ...interface{}) (bool, error) Int64(ctx context.Context, args ...interface{}) (int64, error) Float64(ctx context.Context, args ...interface{}) (float64, error) String(ctx context.Context, args ...interface{}) (string, error) Slice(ctx context.Context, args ...interface{}) ([]interface{}, error) BoolSlice(ctx context.Context, args ...interface{}) ([]bool, error) Int64Slice(ctx context.Context, args ...interface{}) ([]int64, error) Float64Slice(ctx context.Context, args ...interface{}) ([]float64, error) StringSlice(ctx context.Context, args ...interface{}) ([]string, error) ZItemSlice(ctx context.Context, args ...interface{}) ([]ZItem, error) StringMap(ctx context.Context, args ...interface{}) (map[string]string, error) }
type BitmapCommand ¶
type BitmapCommand interface { // BitCount https://redis.io/commands/bitcount // Command: BITCOUNT key [start end] // Integer reply: The number of bits set to 1. BitCount(ctx context.Context, key string, args ...interface{}) (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. BitOpAnd(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. BitOpOr(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. BitOpXor(ctx context.Context, destKey string, keys ...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. BitOpNot(ctx context.Context, destKey string, key string) (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. BitPos(ctx context.Context, key string, bit int64, args ...interface{}) (int64, error) // GetBit https://redis.io/commands/getbit // Command: GETBIT key offset // Integer reply: the bit value stored at offset. GetBit(ctx context.Context, key string, offset int64) (int64, error) // SetBit https://redis.io/commands/setbit // Command: SETBIT key offset value // Integer reply: the original bit value stored at offset. SetBit(ctx context.Context, key string, offset int64, value int) (int64, error) }
type Client ¶
type Client interface { BaseCommand KeyCommand BitmapCommand StringCommand HashCommand ListCommand SetCommand ZSetCommand ServerCommand }
type HashCommand ¶
type HashCommand interface { // 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. HDel(ctx context.Context, key string, fields ...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. HExists(ctx context.Context, key, field string) (bool, 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. HGet(ctx context.Context, key, field 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. HGetAll(ctx context.Context, key string) (map[string]string, error) // HIncrBy https://redis.io/commands/hincrby // Command: HINCRBY key field increment // Integer reply: the value at field after the increment operation. HIncrBy(ctx context.Context, key, field string, incr int64) (int64, error) // HIncrByFloat https://redis.io/commands/hincrbyfloat // Command: HINCRBYFLOAT key field increment // Bulk string reply: the value of field after the increment. HIncrByFloat(ctx context.Context, key, field string, incr float64) (float64, 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. HKeys(ctx context.Context, key string) ([]string, 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. HLen(ctx context.Context, key string) (int64, 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. HMGet(ctx context.Context, key string, fields ...string) ([]interface{}, error) // HSet https://redis.io/commands/hset // Command: HSET key field value [field value ...] // Integer reply: The number of fields that were added. HSet(ctx context.Context, key string, args ...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. HSetNX(ctx context.Context, key, field string, value interface{}) (bool, 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. HStrLen(ctx context.Context, key, field string) (int64, 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. HVals(ctx context.Context, key string) ([]string, error) }
type KeyCommand ¶
type KeyCommand interface { // Del https://redis.io/commands/del // Command: DEL key [key ...] // Integer reply: The number of keys that were removed. Del(ctx context.Context, keys ...string) (int64, 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. Dump(ctx context.Context, key string) (string, 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. Exists(ctx context.Context, keys ...string) (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. Expire(ctx context.Context, key string, expire int64, args ...interface{}) (bool, 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. ExpireAt(ctx context.Context, key string, expireAt int64, args ...interface{}) (bool, error) // Keys https://redis.io/commands/keys // Command: KEYS pattern // Array reply: list of keys matching pattern. Keys(ctx context.Context, pattern string) ([]string, 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. Persist(ctx context.Context, key string) (bool, 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. PExpire(ctx context.Context, key string, expire int64, args ...interface{}) (bool, 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. PExpireAt(ctx context.Context, key string, expireAt int64, args ...interface{}) (bool, 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. PTTL(ctx context.Context, key string) (int64, error) // RandomKey https://redis.io/commands/randomkey // Command: RANDOMKEY // Bulk string reply: the random key, or nil when the database is empty. RandomKey(ctx context.Context) (string, error) // Rename https://redis.io/commands/rename // Command: RENAME key newkey // Simple string reply. Rename(ctx context.Context, key, newKey string) (bool, 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. RenameNX(ctx context.Context, key, newKey string) (bool, error) // Touch https://redis.io/commands/touch // Command: TOUCH key [key ...] // Integer reply: The number of keys that were touched. Touch(ctx context.Context, keys ...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. TTL(ctx context.Context, key string) (int64, error) // Type https://redis.io/commands/type // Command: TYPE key // Simple string reply: type of key, or none when key does not exist. Type(ctx context.Context, key string) (string, error) }
type ListCommand ¶
type ListCommand interface { // LIndex https://redis.io/commands/lindex // Command: LINDEX key index // Bulk string reply: the requested element, or nil when index is out of range. LIndex(ctx context.Context, key string, index int64) (string, 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. LInsertBefore(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. LInsertAfter(ctx context.Context, key string, pivot, value interface{}) (int64, error) // LLen https://redis.io/commands/llen // Command: LLEN key // Integer reply: the length of the list at key. LLen(ctx context.Context, key string) (int64, error) // LMove https://redis.io/commands/lmove // Command: LMOVE source destination LEFT|RIGHT LEFT|RIGHT // Bulk string reply: the element being popped and pushed. LMove(ctx context.Context, source, destination, srcPos, destPos 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. LPop(ctx context.Context, key string) (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. LPopN(ctx context.Context, key string, count int) ([]string, 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). LPos(ctx context.Context, key string, value interface{}, 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). LPosN(ctx context.Context, key string, value interface{}, count int64, args ...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. LPush(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. LPushX(ctx context.Context, key string, values ...interface{}) (int64, error) // LRange https://redis.io/commands/lrange // Command: LRANGE key start stop // Array reply: list of elements in the specified range. LRange(ctx context.Context, key string, start, stop int64) ([]string, error) // LRem https://redis.io/commands/lrem // Command: LREM key count element // Integer reply: the number of removed elements. LRem(ctx context.Context, key string, count int64, value interface{}) (int64, error) // LSet https://redis.io/commands/lset // Command: LSET key index element // Simple string reply LSet(ctx context.Context, key string, index int64, value interface{}) (bool, error) // LTrim https://redis.io/commands/ltrim // Command: LTRIM key start stop // Simple string reply LTrim(ctx context.Context, key string, start, stop int64) (bool, 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. RPop(ctx context.Context, key string) (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. RPopN(ctx context.Context, key string, count int) ([]string, error) // RPopLPush https://redis.io/commands/rpoplpush // Command: RPOPLPUSH source destination // Bulk string reply: the element being popped and pushed. RPopLPush(ctx context.Context, source, destination string) (string, error) // RPush https://redis.io/commands/rpush // Command: RPUSH key element [element ...] // Integer reply: the length of the list after the push operation. RPush(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. RPushX(ctx context.Context, key string, values ...interface{}) (int64, error) }
type Reply ¶
type Reply interface { Bool() (bool, error) Int64() (int64, error) Float64() (float64, error) String() (string, error) Slice() ([]interface{}, error) BoolSlice() ([]bool, error) Int64Slice() ([]int64, error) Float64Slice() ([]float64, error) StringSlice() ([]string, error) ZItemSlice() ([]ZItem, error) StringMap() (map[string]string, error) }
type ServerCommand ¶
type ServerCommand interface { // FlushAll https://redis.io/commands/flushall // Command: FLUSHALL [ASYNC|SYNC] // Simple string reply FlushAll(ctx context.Context, args ...interface{}) (string, error) }
type SetCommand ¶
type SetCommand interface { // 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. SAdd(ctx context.Context, key string, members ...interface{}) (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. SCard(ctx context.Context, key string) (int64, error) // SDiff https://redis.io/commands/sdiff // Command: SDIFF key [key ...] // Array reply: list with members of the resulting set. SDiff(ctx context.Context, keys ...string) ([]string, error) // SDiffStore https://redis.io/commands/sdiffstore // Command: SDIFFSTORE destination key [key ...] // Integer reply: the number of elements in the resulting set. SDiffStore(ctx context.Context, destination string, keys ...string) (int64, error) // SInter https://redis.io/commands/sinter // Command: SINTER key [key ...] // Array reply: list with members of the resulting set. SInter(ctx context.Context, keys ...string) ([]string, error) // SInterStore https://redis.io/commands/sinterstore // Command: SINTERSTORE destination key [key ...] // Integer reply: the number of elements in the resulting set. SInterStore(ctx context.Context, destination string, keys ...string) (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. SIsMember(ctx context.Context, key string, member interface{}) (bool, error) // SMembers https://redis.io/commands/smembers // Command: SMEMBERS key // Array reply: all elements of the set. SMembers(ctx context.Context, key string) ([]string, 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. SMIsMember(ctx context.Context, key string, members ...interface{}) ([]bool, 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. SMove(ctx context.Context, source, destination string, member interface{}) (bool, error) // SPop https://redis.io/commands/spop // Command: SPOP key [count] // Bulk string reply: the removed member, or nil when key does not exist. SPop(ctx context.Context, key string) (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. SPopN(ctx context.Context, key string, count int64) ([]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. SRandMember(ctx context.Context, key string) (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. SRandMemberN(ctx context.Context, key string, count int64) ([]string, 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. SRem(ctx context.Context, key string, members ...interface{}) (int64, error) // SUnion https://redis.io/commands/sunion // Command: SUNION key [key ...] // Array reply: list with members of the resulting set. SUnion(ctx context.Context, keys ...string) ([]string, error) // SUnionStore https://redis.io/commands/sunionstore // Command: SUNIONSTORE destination key [key ...] // Integer reply: the number of elements in the resulting set. SUnionStore(ctx context.Context, destination string, keys ...string) (int64, error) }
type StringCommand ¶
type StringCommand interface { // Append https://redis.io/commands/append // Command: APPEND key value // Integer reply: the length of the string after the append operation. Append(ctx context.Context, key, value string) (int64, error) // Decr https://redis.io/commands/decr // Command: DECR key // Integer reply: the value of key after the decrement Decr(ctx context.Context, key string) (int64, error) // DecrBy https://redis.io/commands/decrby // Command: DECRBY key decrement // Integer reply: the value of key after the decrement. DecrBy(ctx context.Context, key string, decrement int64) (int64, error) // Get https://redis.io/commands/get // Command: GET key // Bulk string reply: the value of key, or nil when key does not exist. Get(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. GetDel(ctx context.Context, key string) (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. GetEx(ctx context.Context, key string, args ...interface{}) (string, error) // GetRange https://redis.io/commands/getrange // Command: GETRANGE key start end // Bulk string reply GetRange(ctx context.Context, key string, start, end int64) (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. GetSet(ctx context.Context, key string, value interface{}) (string, error) // Incr https://redis.io/commands/incr // Command: INCR key // Integer reply: the value of key after the increment Incr(ctx context.Context, key string) (int64, error) // IncrBy https://redis.io/commands/incrby // Command: INCRBY key increment // Integer reply: the value of key after the increment. IncrBy(ctx context.Context, key string, value int64) (int64, error) // IncrByFloat https://redis.io/commands/incrbyfloat // Command: INCRBYFLOAT key increment // Bulk string reply: the value of key after the increment. IncrByFloat(ctx context.Context, key string, value float64) (float64, error) // MGet https://redis.io/commands/mget // Command: MGET key [key ...] // Array reply: list of values at the specified keys. MGet(ctx context.Context, keys ...string) ([]interface{}, error) // MSet https://redis.io/commands/mset // Command: MSET key value [key value ...] // Simple string reply: always OK since MSET can't fail. MSet(ctx context.Context, args ...interface{}) (bool, 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). MSetNX(ctx context.Context, args ...interface{}) (bool, error) // PSetEX https://redis.io/commands/psetex // Command: PSETEX key milliseconds value // Simple string reply PSetEX(ctx context.Context, key string, value interface{}, expire int64) (bool, 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. Set(ctx context.Context, key string, value interface{}, args ...interface{}) (bool, error) // SetEX https://redis.io/commands/setex // Command: SETEX key seconds value // Simple string reply SetEX(ctx context.Context, key string, value interface{}, expire int64) (bool, 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. SetNX(ctx context.Context, key string, value interface{}) (bool, 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. SetRange(ctx context.Context, key string, offset int64, value 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. StrLen(ctx context.Context, key string) (int64, error) }
type ZSetCommand ¶
type ZSetCommand interface { // 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). ZAdd(ctx context.Context, key string, args ...interface{}) (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. ZCard(ctx context.Context, key 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. ZCount(ctx context.Context, key, min, max string) (int64, error) // ZDiff https://redis.io/commands/zdiff // Command: ZDIFF numkeys key [key ...] [WITHSCORES] // Array reply: the result of the difference. ZDiff(ctx context.Context, keys ...string) ([]string, error) // ZDiffWithScores https://redis.io/commands/zdiff // Command: ZDIFF numkeys key [key ...] [WITHSCORES] // Array reply: the result of the difference. ZDiffWithScores(ctx context.Context, keys ...string) ([]ZItem, 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. ZIncrBy(ctx context.Context, key string, increment float64, member string) (float64, 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. ZInter(ctx context.Context, args ...interface{}) ([]string, 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. ZInterWithScores(ctx context.Context, args ...interface{}) ([]ZItem, error) // ZLexCount https://redis.io/commands/zlexcount // Command: ZLEXCOUNT key min max // Integer reply: the number of elements in the specified score range. ZLexCount(ctx context.Context, key, min, max string) (int64, 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. ZMScore(ctx context.Context, key string, members ...string) ([]float64, error) // ZPopMax https://redis.io/commands/zpopmax // Command: ZPOPMAX key [count] // Array reply: list of popped elements and scores. ZPopMax(ctx context.Context, key string) ([]ZItem, error) // ZPopMaxN https://redis.io/commands/zpopmax // Command: ZPOPMAX key [count] // Array reply: list of popped elements and scores. ZPopMaxN(ctx context.Context, key string, count int64) ([]ZItem, error) // ZPopMin https://redis.io/commands/zpopmin // Command: ZPOPMIN key [count] // Array reply: list of popped elements and scores. ZPopMin(ctx context.Context, key string) ([]ZItem, error) // ZPopMinN https://redis.io/commands/zpopmin // Command: ZPOPMIN key [count] // Array reply: list of popped elements and scores. ZPopMinN(ctx context.Context, key string, count int64) ([]ZItem, 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. ZRandMember(ctx context.Context, key string) (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. ZRandMemberN(ctx context.Context, key string, count int) ([]string, 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. ZRandMemberWithScores(ctx context.Context, key string, count int) ([]ZItem, 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. ZRange(ctx context.Context, key string, start, stop int64, args ...interface{}) ([]string, 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. ZRangeWithScores(ctx context.Context, key string, start, stop int64, args ...interface{}) ([]ZItem, 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. ZRangeByLex(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. ZRangeByScore(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, 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. ZRank(ctx context.Context, key, member string) (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. ZRem(ctx context.Context, key string, members ...interface{}) (int64, error) // ZRemRangeByLex https://redis.io/commands/zremrangebylex // Command: ZREMRANGEBYLEX key min max // Integer reply: the number of elements removed. ZRemRangeByLex(ctx context.Context, key, min, max string) (int64, error) // ZRemRangeByRank https://redis.io/commands/zremrangebyrank // Command: ZREMRANGEBYRANK key start stop // Integer reply: the number of elements removed. ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (int64, error) // ZRemRangeByScore https://redis.io/commands/zremrangebyscore // Command: ZREMRANGEBYSCORE key min max // Integer reply: the number of elements removed. ZRemRangeByScore(ctx context.Context, key, min, max string) (int64, error) // ZRevRange https://redis.io/commands/zrevrange // Command: ZREVRANGE key start stop [WITHSCORES] // Array reply: list of elements in the specified range. ZRevRange(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. ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]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. ZRevRangeByLex(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. ZRevRangeByScore(ctx context.Context, key string, min, max string, args ...interface{}) ([]string, 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. ZRevRank(ctx context.Context, key, member string) (int64, 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. ZScore(ctx context.Context, key, member string) (float64, 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. ZUnion(ctx context.Context, args ...interface{}) ([]string, 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. ZUnionWithScores(ctx context.Context, args ...interface{}) ([]ZItem, 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. ZUnionStore(ctx context.Context, dest string, args ...interface{}) (int64, error) }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.