Documentation ¶
Overview ¶
Package redis implements a Redis client.
Example (CustomCommand) ¶
Get := func(client *redis.Client, key string) *redis.StringCmd { cmd := redis.NewStringCmd("GET", key) client.Process(cmd) return cmd } v, err := Get(client, "key_does_not_exist").Result() fmt.Printf("%q %s", v, err)
Output: "" redis: nil
Index ¶
- Variables
- type BitCount
- type BoolCmd
- type BoolSliceCmd
- type Client
- func (c *Client) Append(key, value string) *IntCmd
- func (c *Client) Auth(password string) *StatusCmd
- func (c *Client) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *Client) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *Client) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd
- func (c *Client) BgRewriteAOF() *StatusCmd
- func (c *Client) BgSave() *StatusCmd
- func (c *Client) BitCount(key string, bitCount *BitCount) *IntCmd
- func (c *Client) BitOpAnd(destKey string, keys ...string) *IntCmd
- func (c *Client) BitOpNot(destKey string, key string) *IntCmd
- func (c *Client) BitOpOr(destKey string, keys ...string) *IntCmd
- func (c *Client) BitOpXor(destKey string, keys ...string) *IntCmd
- func (c *Client) BitPos(key string, bit int64, pos ...int64) *IntCmd
- func (c *Client) ClientKill(ipPort string) *StatusCmd
- func (c *Client) ClientList() *StringCmd
- func (c *Client) ClientPause(dur time.Duration) *BoolCmd
- func (c Client) Close() error
- func (c *Client) ClusterAddSlots(slots ...int) *StatusCmd
- func (c *Client) ClusterAddSlotsRange(min, max int) *StatusCmd
- func (c *Client) ClusterFailover() *StatusCmd
- func (c *Client) ClusterInfo() *StringCmd
- func (c *Client) ClusterMeet(host, port string) *StatusCmd
- func (c *Client) ClusterNodes() *StringCmd
- func (c *Client) ClusterReplicate(nodeID string) *StatusCmd
- func (c *Client) ClusterSlots() *ClusterSlotCmd
- func (c *Client) ConfigGet(parameter string) *SliceCmd
- func (c *Client) ConfigResetStat() *StatusCmd
- func (c *Client) ConfigSet(parameter, value string) *StatusCmd
- func (c *Client) DbSize() *IntCmd
- func (c *Client) DebugObject(key string) *StringCmd
- func (c *Client) Decr(key string) *IntCmd
- func (c *Client) DecrBy(key string, decrement int64) *IntCmd
- func (c *Client) Del(keys ...string) *IntCmd
- func (c *Client) Dump(key string) *StringCmd
- func (c *Client) Echo(message string) *StringCmd
- func (c *Client) Eval(script string, keys []string, args []string) *Cmd
- func (c *Client) EvalSha(sha1 string, keys []string, args []string) *Cmd
- func (c *Client) Exists(key string) *BoolCmd
- func (c *Client) Expire(key string, expiration time.Duration) *BoolCmd
- func (c *Client) ExpireAt(key string, tm time.Time) *BoolCmd
- func (c *Client) FlushAll() *StatusCmd
- func (c *Client) FlushDb() *StatusCmd
- func (c *Client) Get(key string) *StringCmd
- func (c *Client) GetBit(key string, offset int64) *IntCmd
- func (c *Client) GetRange(key string, start, end int64) *StringCmd
- func (c *Client) GetSet(key, value string) *StringCmd
- func (c *Client) HDel(key string, fields ...string) *IntCmd
- func (c *Client) HExists(key, field string) *BoolCmd
- func (c *Client) HGet(key, field string) *StringCmd
- func (c *Client) HGetAll(key string) *StringSliceCmd
- func (c *Client) HGetAllMap(key string) *StringStringMapCmd
- func (c *Client) HIncrBy(key, field string, incr int64) *IntCmd
- func (c *Client) HIncrByFloat(key, field string, incr float64) *FloatCmd
- func (c *Client) HKeys(key string) *StringSliceCmd
- func (c *Client) HLen(key string) *IntCmd
- func (c *Client) HMGet(key string, fields ...string) *SliceCmd
- func (c *Client) HMSet(key, field, value string, pairs ...string) *StatusCmd
- func (c *Client) HScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Client) HSet(key, field, value string) *BoolCmd
- func (c *Client) HSetNX(key, field, value string) *BoolCmd
- func (c *Client) HVals(key string) *StringSliceCmd
- func (c *Client) Incr(key string) *IntCmd
- func (c *Client) IncrBy(key string, value int64) *IntCmd
- func (c *Client) IncrByFloat(key string, value float64) *FloatCmd
- func (c *Client) Info() *StringCmd
- func (c *Client) Keys(pattern string) *StringSliceCmd
- func (c *Client) LIndex(key string, index int64) *StringCmd
- func (c *Client) LInsert(key, op, pivot, value string) *IntCmd
- func (c *Client) LLen(key string) *IntCmd
- func (c *Client) LPop(key string) *StringCmd
- func (c *Client) LPush(key string, values ...string) *IntCmd
- func (c *Client) LPushX(key, value string) *IntCmd
- func (c *Client) LRange(key string, start, stop int64) *StringSliceCmd
- func (c *Client) LRem(key string, count int64, value string) *IntCmd
- func (c *Client) LSet(key string, index int64, value string) *StatusCmd
- func (c *Client) LTrim(key string, start, stop int64) *StatusCmd
- func (c *Client) LastSave() *IntCmd
- func (c *Client) MGet(keys ...string) *SliceCmd
- func (c *Client) MSet(pairs ...string) *StatusCmd
- func (c *Client) MSetNX(pairs ...string) *BoolCmd
- func (c *Client) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd
- func (c *Client) Move(key string, db int64) *BoolCmd
- func (c *Client) Multi() *Multi
- func (c *Client) ObjectEncoding(keys ...string) *StringCmd
- func (c *Client) ObjectIdleTime(keys ...string) *DurationCmd
- func (c *Client) ObjectRefCount(keys ...string) *IntCmd
- func (c *Client) PExpire(key string, expiration time.Duration) *BoolCmd
- func (c *Client) PExpireAt(key string, tm time.Time) *BoolCmd
- func (c *Client) PTTL(key string) *DurationCmd
- func (c *Client) Persist(key string) *BoolCmd
- func (c *Client) Ping() *StatusCmd
- func (c *Client) Pipeline() *Pipeline
- func (c *Client) Pipelined(fn func(*Pipeline) error) ([]Cmder, error)
- func (c *Client) Process(cmd Cmder)
- func (c *Client) PubSub() *PubSub
- func (c *Client) PubSubChannels(pattern string) *StringSliceCmd
- func (c *Client) PubSubNumPat() *IntCmd
- func (c *Client) PubSubNumSub(channels ...string) *StringIntMapCmd
- func (c *Client) Publish(channel, message string) *IntCmd
- func (c *Client) Quit() *StatusCmd
- func (c *Client) RPop(key string) *StringCmd
- func (c *Client) RPopLPush(source, destination string) *StringCmd
- func (c *Client) RPush(key string, values ...string) *IntCmd
- func (c *Client) RPushX(key string, value string) *IntCmd
- func (c *Client) RandomKey() *StringCmd
- func (c *Client) Rename(key, newkey string) *StatusCmd
- func (c *Client) RenameNX(key, newkey string) *BoolCmd
- func (c *Client) Restore(key string, ttl int64, value string) *StatusCmd
- func (c *Client) SAdd(key string, members ...string) *IntCmd
- func (c *Client) SCard(key string) *IntCmd
- func (c *Client) SDiff(keys ...string) *StringSliceCmd
- func (c *Client) SDiffStore(destination string, keys ...string) *IntCmd
- func (c *Client) SInter(keys ...string) *StringSliceCmd
- func (c *Client) SInterStore(destination string, keys ...string) *IntCmd
- func (c *Client) SIsMember(key, member string) *BoolCmd
- func (c *Client) SMembers(key string) *StringSliceCmd
- func (c *Client) SMove(source, destination, member string) *BoolCmd
- func (c *Client) SPop(key string) *StringCmd
- func (c *Client) SRandMember(key string) *StringCmd
- func (c *Client) SRem(key string, members ...string) *IntCmd
- func (c *Client) SScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Client) SUnion(keys ...string) *StringSliceCmd
- func (c *Client) SUnionStore(destination string, keys ...string) *IntCmd
- func (c *Client) Save() *StatusCmd
- func (c *Client) Scan(cursor int64, match string, count int64) *ScanCmd
- func (c *Client) ScriptExists(scripts ...string) *BoolSliceCmd
- func (c *Client) ScriptFlush() *StatusCmd
- func (c *Client) ScriptKill() *StatusCmd
- func (c *Client) ScriptLoad(script string) *StringCmd
- func (c *Client) Select(index int64) *StatusCmd
- func (c *Client) Set(key, value string, expiration time.Duration) *StatusCmd
- func (c *Client) SetBit(key string, offset int64, value int) *IntCmd
- func (c *Client) SetNX(key, value string, expiration time.Duration) *BoolCmd
- func (c *Client) SetRange(key string, offset int64, value string) *IntCmd
- func (c *Client) SetXX(key, value string, expiration time.Duration) *BoolCmd
- func (c *Client) Shutdown() *StatusCmd
- func (c *Client) ShutdownNoSave() *StatusCmd
- func (c *Client) ShutdownSave() *StatusCmd
- func (c *Client) SlaveOf(host, port string) *StatusCmd
- func (c *Client) SlowLog()
- func (c *Client) Sort(key string, sort Sort) *StringSliceCmd
- func (c *Client) StrLen(key string) *IntCmd
- func (c Client) String() string
- func (c *Client) Sync()
- func (c *Client) TTL(key string) *DurationCmd
- func (c *Client) Time() *StringSliceCmd
- func (c *Client) Type(key string) *StatusCmd
- func (c *Client) ZAdd(key string, members ...Z) *IntCmd
- func (c *Client) ZCard(key string) *IntCmd
- func (c *Client) ZCount(key, min, max string) *IntCmd
- func (c *Client) ZIncrBy(key string, increment float64, member string) *FloatCmd
- func (c *Client) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd
- func (c *Client) ZRange(key string, start, stop int64) *StringSliceCmd
- func (c *Client) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *Client) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *Client) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *Client) ZRank(key, member string) *IntCmd
- func (c *Client) ZRem(key string, members ...string) *IntCmd
- func (c *Client) ZRemRangeByRank(key string, start, stop int64) *IntCmd
- func (c *Client) ZRemRangeByScore(key, min, max string) *IntCmd
- func (c *Client) ZRevRange(key string, start, stop int64) *StringSliceCmd
- func (c *Client) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *Client) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *Client) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *Client) ZRevRank(key, member string) *IntCmd
- func (c *Client) ZScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Client) ZScore(key, member string) *FloatCmd
- func (c *Client) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd
- type ClusterClient
- func (c *ClusterClient) Append(key, value string) *IntCmd
- func (c *ClusterClient) Auth(password string) *StatusCmd
- func (c *ClusterClient) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *ClusterClient) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *ClusterClient) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd
- func (c *ClusterClient) BgRewriteAOF() *StatusCmd
- func (c *ClusterClient) BgSave() *StatusCmd
- func (c *ClusterClient) BitCount(key string, bitCount *BitCount) *IntCmd
- func (c *ClusterClient) BitOpAnd(destKey string, keys ...string) *IntCmd
- func (c *ClusterClient) BitOpNot(destKey string, key string) *IntCmd
- func (c *ClusterClient) BitOpOr(destKey string, keys ...string) *IntCmd
- func (c *ClusterClient) BitOpXor(destKey string, keys ...string) *IntCmd
- func (c *ClusterClient) BitPos(key string, bit int64, pos ...int64) *IntCmd
- func (c *ClusterClient) ClientKill(ipPort string) *StatusCmd
- func (c *ClusterClient) ClientList() *StringCmd
- func (c *ClusterClient) ClientPause(dur time.Duration) *BoolCmd
- func (c *ClusterClient) Close() error
- func (c *ClusterClient) ClusterAddSlots(slots ...int) *StatusCmd
- func (c *ClusterClient) ClusterAddSlotsRange(min, max int) *StatusCmd
- func (c *ClusterClient) ClusterFailover() *StatusCmd
- func (c *ClusterClient) ClusterInfo() *StringCmd
- func (c *ClusterClient) ClusterMeet(host, port string) *StatusCmd
- func (c *ClusterClient) ClusterNodes() *StringCmd
- func (c *ClusterClient) ClusterReplicate(nodeID string) *StatusCmd
- func (c *ClusterClient) ClusterSlots() *ClusterSlotCmd
- func (c *ClusterClient) ConfigGet(parameter string) *SliceCmd
- func (c *ClusterClient) ConfigResetStat() *StatusCmd
- func (c *ClusterClient) ConfigSet(parameter, value string) *StatusCmd
- func (c *ClusterClient) DbSize() *IntCmd
- func (c *ClusterClient) DebugObject(key string) *StringCmd
- func (c *ClusterClient) Decr(key string) *IntCmd
- func (c *ClusterClient) DecrBy(key string, decrement int64) *IntCmd
- func (c *ClusterClient) Del(keys ...string) *IntCmd
- func (c *ClusterClient) Dump(key string) *StringCmd
- func (c *ClusterClient) Echo(message string) *StringCmd
- func (c *ClusterClient) Eval(script string, keys []string, args []string) *Cmd
- func (c *ClusterClient) EvalSha(sha1 string, keys []string, args []string) *Cmd
- func (c *ClusterClient) Exists(key string) *BoolCmd
- func (c *ClusterClient) Expire(key string, expiration time.Duration) *BoolCmd
- func (c *ClusterClient) ExpireAt(key string, tm time.Time) *BoolCmd
- func (c *ClusterClient) FlushAll() *StatusCmd
- func (c *ClusterClient) FlushDb() *StatusCmd
- func (c *ClusterClient) Get(key string) *StringCmd
- func (c *ClusterClient) GetBit(key string, offset int64) *IntCmd
- func (c *ClusterClient) GetRange(key string, start, end int64) *StringCmd
- func (c *ClusterClient) GetSet(key, value string) *StringCmd
- func (c *ClusterClient) HDel(key string, fields ...string) *IntCmd
- func (c *ClusterClient) HExists(key, field string) *BoolCmd
- func (c *ClusterClient) HGet(key, field string) *StringCmd
- func (c *ClusterClient) HGetAll(key string) *StringSliceCmd
- func (c *ClusterClient) HGetAllMap(key string) *StringStringMapCmd
- func (c *ClusterClient) HIncrBy(key, field string, incr int64) *IntCmd
- func (c *ClusterClient) HIncrByFloat(key, field string, incr float64) *FloatCmd
- func (c *ClusterClient) HKeys(key string) *StringSliceCmd
- func (c *ClusterClient) HLen(key string) *IntCmd
- func (c *ClusterClient) HMGet(key string, fields ...string) *SliceCmd
- func (c *ClusterClient) HMSet(key, field, value string, pairs ...string) *StatusCmd
- func (c *ClusterClient) HScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *ClusterClient) HSet(key, field, value string) *BoolCmd
- func (c *ClusterClient) HSetNX(key, field, value string) *BoolCmd
- func (c *ClusterClient) HVals(key string) *StringSliceCmd
- func (c *ClusterClient) Incr(key string) *IntCmd
- func (c *ClusterClient) IncrBy(key string, value int64) *IntCmd
- func (c *ClusterClient) IncrByFloat(key string, value float64) *FloatCmd
- func (c *ClusterClient) Info() *StringCmd
- func (c *ClusterClient) Keys(pattern string) *StringSliceCmd
- func (c *ClusterClient) LIndex(key string, index int64) *StringCmd
- func (c *ClusterClient) LInsert(key, op, pivot, value string) *IntCmd
- func (c *ClusterClient) LLen(key string) *IntCmd
- func (c *ClusterClient) LPop(key string) *StringCmd
- func (c *ClusterClient) LPush(key string, values ...string) *IntCmd
- func (c *ClusterClient) LPushX(key, value string) *IntCmd
- func (c *ClusterClient) LRange(key string, start, stop int64) *StringSliceCmd
- func (c *ClusterClient) LRem(key string, count int64, value string) *IntCmd
- func (c *ClusterClient) LSet(key string, index int64, value string) *StatusCmd
- func (c *ClusterClient) LTrim(key string, start, stop int64) *StatusCmd
- func (c *ClusterClient) LastSave() *IntCmd
- func (c *ClusterClient) MGet(keys ...string) *SliceCmd
- func (c *ClusterClient) MSet(pairs ...string) *StatusCmd
- func (c *ClusterClient) MSetNX(pairs ...string) *BoolCmd
- func (c *ClusterClient) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd
- func (c *ClusterClient) Move(key string, db int64) *BoolCmd
- func (c *ClusterClient) ObjectEncoding(keys ...string) *StringCmd
- func (c *ClusterClient) ObjectIdleTime(keys ...string) *DurationCmd
- func (c *ClusterClient) ObjectRefCount(keys ...string) *IntCmd
- func (c *ClusterClient) PExpire(key string, expiration time.Duration) *BoolCmd
- func (c *ClusterClient) PExpireAt(key string, tm time.Time) *BoolCmd
- func (c *ClusterClient) PTTL(key string) *DurationCmd
- func (c *ClusterClient) Persist(key string) *BoolCmd
- func (c *ClusterClient) Ping() *StatusCmd
- func (c *ClusterClient) Pipeline() *ClusterPipeline
- func (c *ClusterClient) Process(cmd Cmder)
- func (c *ClusterClient) PubSubChannels(pattern string) *StringSliceCmd
- func (c *ClusterClient) PubSubNumPat() *IntCmd
- func (c *ClusterClient) PubSubNumSub(channels ...string) *StringIntMapCmd
- func (c *ClusterClient) Quit() *StatusCmd
- func (c *ClusterClient) RPop(key string) *StringCmd
- func (c *ClusterClient) RPopLPush(source, destination string) *StringCmd
- func (c *ClusterClient) RPush(key string, values ...string) *IntCmd
- func (c *ClusterClient) RPushX(key string, value string) *IntCmd
- func (c *ClusterClient) RandomKey() *StringCmd
- func (c *ClusterClient) Rename(key, newkey string) *StatusCmd
- func (c *ClusterClient) RenameNX(key, newkey string) *BoolCmd
- func (c *ClusterClient) Restore(key string, ttl int64, value string) *StatusCmd
- func (c *ClusterClient) SAdd(key string, members ...string) *IntCmd
- func (c *ClusterClient) SCard(key string) *IntCmd
- func (c *ClusterClient) SDiff(keys ...string) *StringSliceCmd
- func (c *ClusterClient) SDiffStore(destination string, keys ...string) *IntCmd
- func (c *ClusterClient) SInter(keys ...string) *StringSliceCmd
- func (c *ClusterClient) SInterStore(destination string, keys ...string) *IntCmd
- func (c *ClusterClient) SIsMember(key, member string) *BoolCmd
- func (c *ClusterClient) SMembers(key string) *StringSliceCmd
- func (c *ClusterClient) SMove(source, destination, member string) *BoolCmd
- func (c *ClusterClient) SPop(key string) *StringCmd
- func (c *ClusterClient) SRandMember(key string) *StringCmd
- func (c *ClusterClient) SRem(key string, members ...string) *IntCmd
- func (c *ClusterClient) SScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *ClusterClient) SUnion(keys ...string) *StringSliceCmd
- func (c *ClusterClient) SUnionStore(destination string, keys ...string) *IntCmd
- func (c *ClusterClient) Save() *StatusCmd
- func (c *ClusterClient) Scan(cursor int64, match string, count int64) *ScanCmd
- func (c *ClusterClient) ScriptExists(scripts ...string) *BoolSliceCmd
- func (c *ClusterClient) ScriptFlush() *StatusCmd
- func (c *ClusterClient) ScriptKill() *StatusCmd
- func (c *ClusterClient) ScriptLoad(script string) *StringCmd
- func (c *ClusterClient) Select(index int64) *StatusCmd
- func (c *ClusterClient) Set(key, value string, expiration time.Duration) *StatusCmd
- func (c *ClusterClient) SetBit(key string, offset int64, value int) *IntCmd
- func (c *ClusterClient) SetNX(key, value string, expiration time.Duration) *BoolCmd
- func (c *ClusterClient) SetRange(key string, offset int64, value string) *IntCmd
- func (c *ClusterClient) Shutdown() *StatusCmd
- func (c *ClusterClient) ShutdownNoSave() *StatusCmd
- func (c *ClusterClient) ShutdownSave() *StatusCmd
- func (c *ClusterClient) SlaveOf(host, port string) *StatusCmd
- func (c *ClusterClient) SlowLog()
- func (c *ClusterClient) Sort(key string, sort Sort) *StringSliceCmd
- func (c *ClusterClient) StrLen(key string) *IntCmd
- func (c *ClusterClient) Sync()
- func (c *ClusterClient) TTL(key string) *DurationCmd
- func (c *ClusterClient) Time() *StringSliceCmd
- func (c *ClusterClient) Type(key string) *StatusCmd
- func (c *ClusterClient) ZAdd(key string, members ...Z) *IntCmd
- func (c *ClusterClient) ZCard(key string) *IntCmd
- func (c *ClusterClient) ZCount(key, min, max string) *IntCmd
- func (c *ClusterClient) ZIncrBy(key string, increment float64, member string) *FloatCmd
- func (c *ClusterClient) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd
- func (c *ClusterClient) ZRange(key string, start, stop int64) *StringSliceCmd
- func (c *ClusterClient) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *ClusterClient) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *ClusterClient) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *ClusterClient) ZRank(key, member string) *IntCmd
- func (c *ClusterClient) ZRem(key string, members ...string) *IntCmd
- func (c *ClusterClient) ZRemRangeByRank(key string, start, stop int64) *IntCmd
- func (c *ClusterClient) ZRemRangeByScore(key, min, max string) *IntCmd
- func (c *ClusterClient) ZRevRange(key string, start, stop int64) *StringSliceCmd
- func (c *ClusterClient) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *ClusterClient) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *ClusterClient) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *ClusterClient) ZRevRank(key, member string) *IntCmd
- func (c *ClusterClient) ZScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *ClusterClient) ZScore(key, member string) *FloatCmd
- func (c *ClusterClient) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd
- type ClusterOptions
- type ClusterPipeline
- func (c *ClusterPipeline) Append(key, value string) *IntCmd
- func (c *ClusterPipeline) Auth(password string) *StatusCmd
- func (c *ClusterPipeline) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *ClusterPipeline) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *ClusterPipeline) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd
- func (c *ClusterPipeline) BgRewriteAOF() *StatusCmd
- func (c *ClusterPipeline) BgSave() *StatusCmd
- func (c *ClusterPipeline) BitCount(key string, bitCount *BitCount) *IntCmd
- func (c *ClusterPipeline) BitOpAnd(destKey string, keys ...string) *IntCmd
- func (c *ClusterPipeline) BitOpNot(destKey string, key string) *IntCmd
- func (c *ClusterPipeline) BitOpOr(destKey string, keys ...string) *IntCmd
- func (c *ClusterPipeline) BitOpXor(destKey string, keys ...string) *IntCmd
- func (c *ClusterPipeline) BitPos(key string, bit int64, pos ...int64) *IntCmd
- func (c *ClusterPipeline) ClientKill(ipPort string) *StatusCmd
- func (c *ClusterPipeline) ClientList() *StringCmd
- func (c *ClusterPipeline) ClientPause(dur time.Duration) *BoolCmd
- func (pipe *ClusterPipeline) Close() error
- func (c *ClusterPipeline) ClusterAddSlots(slots ...int) *StatusCmd
- func (c *ClusterPipeline) ClusterAddSlotsRange(min, max int) *StatusCmd
- func (c *ClusterPipeline) ClusterFailover() *StatusCmd
- func (c *ClusterPipeline) ClusterInfo() *StringCmd
- func (c *ClusterPipeline) ClusterMeet(host, port string) *StatusCmd
- func (c *ClusterPipeline) ClusterNodes() *StringCmd
- func (c *ClusterPipeline) ClusterReplicate(nodeID string) *StatusCmd
- func (c *ClusterPipeline) ClusterSlots() *ClusterSlotCmd
- func (c *ClusterPipeline) ConfigGet(parameter string) *SliceCmd
- func (c *ClusterPipeline) ConfigResetStat() *StatusCmd
- func (c *ClusterPipeline) ConfigSet(parameter, value string) *StatusCmd
- func (c *ClusterPipeline) DbSize() *IntCmd
- func (c *ClusterPipeline) DebugObject(key string) *StringCmd
- func (c *ClusterPipeline) Decr(key string) *IntCmd
- func (c *ClusterPipeline) DecrBy(key string, decrement int64) *IntCmd
- func (c *ClusterPipeline) Del(keys ...string) *IntCmd
- func (pipe *ClusterPipeline) Discard() error
- func (c *ClusterPipeline) Dump(key string) *StringCmd
- func (c *ClusterPipeline) Echo(message string) *StringCmd
- func (c *ClusterPipeline) Eval(script string, keys []string, args []string) *Cmd
- func (c *ClusterPipeline) EvalSha(sha1 string, keys []string, args []string) *Cmd
- func (pipe *ClusterPipeline) Exec() (cmds []Cmder, retErr error)
- func (c *ClusterPipeline) Exists(key string) *BoolCmd
- func (c *ClusterPipeline) Expire(key string, expiration time.Duration) *BoolCmd
- func (c *ClusterPipeline) ExpireAt(key string, tm time.Time) *BoolCmd
- func (c *ClusterPipeline) FlushAll() *StatusCmd
- func (c *ClusterPipeline) FlushDb() *StatusCmd
- func (c *ClusterPipeline) Get(key string) *StringCmd
- func (c *ClusterPipeline) GetBit(key string, offset int64) *IntCmd
- func (c *ClusterPipeline) GetRange(key string, start, end int64) *StringCmd
- func (c *ClusterPipeline) GetSet(key, value string) *StringCmd
- func (c *ClusterPipeline) HDel(key string, fields ...string) *IntCmd
- func (c *ClusterPipeline) HExists(key, field string) *BoolCmd
- func (c *ClusterPipeline) HGet(key, field string) *StringCmd
- func (c *ClusterPipeline) HGetAll(key string) *StringSliceCmd
- func (c *ClusterPipeline) HGetAllMap(key string) *StringStringMapCmd
- func (c *ClusterPipeline) HIncrBy(key, field string, incr int64) *IntCmd
- func (c *ClusterPipeline) HIncrByFloat(key, field string, incr float64) *FloatCmd
- func (c *ClusterPipeline) HKeys(key string) *StringSliceCmd
- func (c *ClusterPipeline) HLen(key string) *IntCmd
- func (c *ClusterPipeline) HMGet(key string, fields ...string) *SliceCmd
- func (c *ClusterPipeline) HMSet(key, field, value string, pairs ...string) *StatusCmd
- func (c *ClusterPipeline) HScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *ClusterPipeline) HSet(key, field, value string) *BoolCmd
- func (c *ClusterPipeline) HSetNX(key, field, value string) *BoolCmd
- func (c *ClusterPipeline) HVals(key string) *StringSliceCmd
- func (c *ClusterPipeline) Incr(key string) *IntCmd
- func (c *ClusterPipeline) IncrBy(key string, value int64) *IntCmd
- func (c *ClusterPipeline) IncrByFloat(key string, value float64) *FloatCmd
- func (c *ClusterPipeline) Info() *StringCmd
- func (c *ClusterPipeline) Keys(pattern string) *StringSliceCmd
- func (c *ClusterPipeline) LIndex(key string, index int64) *StringCmd
- func (c *ClusterPipeline) LInsert(key, op, pivot, value string) *IntCmd
- func (c *ClusterPipeline) LLen(key string) *IntCmd
- func (c *ClusterPipeline) LPop(key string) *StringCmd
- func (c *ClusterPipeline) LPush(key string, values ...string) *IntCmd
- func (c *ClusterPipeline) LPushX(key, value string) *IntCmd
- func (c *ClusterPipeline) LRange(key string, start, stop int64) *StringSliceCmd
- func (c *ClusterPipeline) LRem(key string, count int64, value string) *IntCmd
- func (c *ClusterPipeline) LSet(key string, index int64, value string) *StatusCmd
- func (c *ClusterPipeline) LTrim(key string, start, stop int64) *StatusCmd
- func (c *ClusterPipeline) LastSave() *IntCmd
- func (c *ClusterPipeline) MGet(keys ...string) *SliceCmd
- func (c *ClusterPipeline) MSet(pairs ...string) *StatusCmd
- func (c *ClusterPipeline) MSetNX(pairs ...string) *BoolCmd
- func (c *ClusterPipeline) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd
- func (c *ClusterPipeline) Move(key string, db int64) *BoolCmd
- func (c *ClusterPipeline) ObjectEncoding(keys ...string) *StringCmd
- func (c *ClusterPipeline) ObjectIdleTime(keys ...string) *DurationCmd
- func (c *ClusterPipeline) ObjectRefCount(keys ...string) *IntCmd
- func (c *ClusterPipeline) PExpire(key string, expiration time.Duration) *BoolCmd
- func (c *ClusterPipeline) PExpireAt(key string, tm time.Time) *BoolCmd
- func (c *ClusterPipeline) PTTL(key string) *DurationCmd
- func (c *ClusterPipeline) Persist(key string) *BoolCmd
- func (c *ClusterPipeline) Ping() *StatusCmd
- func (c *ClusterPipeline) Process(cmd Cmder)
- func (c *ClusterPipeline) PubSubChannels(pattern string) *StringSliceCmd
- func (c *ClusterPipeline) PubSubNumPat() *IntCmd
- func (c *ClusterPipeline) PubSubNumSub(channels ...string) *StringIntMapCmd
- func (c *ClusterPipeline) Quit() *StatusCmd
- func (c *ClusterPipeline) RPop(key string) *StringCmd
- func (c *ClusterPipeline) RPopLPush(source, destination string) *StringCmd
- func (c *ClusterPipeline) RPush(key string, values ...string) *IntCmd
- func (c *ClusterPipeline) RPushX(key string, value string) *IntCmd
- func (c *ClusterPipeline) RandomKey() *StringCmd
- func (c *ClusterPipeline) Rename(key, newkey string) *StatusCmd
- func (c *ClusterPipeline) RenameNX(key, newkey string) *BoolCmd
- func (c *ClusterPipeline) Restore(key string, ttl int64, value string) *StatusCmd
- func (c *ClusterPipeline) SAdd(key string, members ...string) *IntCmd
- func (c *ClusterPipeline) SCard(key string) *IntCmd
- func (c *ClusterPipeline) SDiff(keys ...string) *StringSliceCmd
- func (c *ClusterPipeline) SDiffStore(destination string, keys ...string) *IntCmd
- func (c *ClusterPipeline) SInter(keys ...string) *StringSliceCmd
- func (c *ClusterPipeline) SInterStore(destination string, keys ...string) *IntCmd
- func (c *ClusterPipeline) SIsMember(key, member string) *BoolCmd
- func (c *ClusterPipeline) SMembers(key string) *StringSliceCmd
- func (c *ClusterPipeline) SMove(source, destination, member string) *BoolCmd
- func (c *ClusterPipeline) SPop(key string) *StringCmd
- func (c *ClusterPipeline) SRandMember(key string) *StringCmd
- func (c *ClusterPipeline) SRem(key string, members ...string) *IntCmd
- func (c *ClusterPipeline) SScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *ClusterPipeline) SUnion(keys ...string) *StringSliceCmd
- func (c *ClusterPipeline) SUnionStore(destination string, keys ...string) *IntCmd
- func (c *ClusterPipeline) Save() *StatusCmd
- func (c *ClusterPipeline) Scan(cursor int64, match string, count int64) *ScanCmd
- func (c *ClusterPipeline) ScriptExists(scripts ...string) *BoolSliceCmd
- func (c *ClusterPipeline) ScriptFlush() *StatusCmd
- func (c *ClusterPipeline) ScriptKill() *StatusCmd
- func (c *ClusterPipeline) ScriptLoad(script string) *StringCmd
- func (c *ClusterPipeline) Select(index int64) *StatusCmd
- func (c *ClusterPipeline) Set(key, value string, expiration time.Duration) *StatusCmd
- func (c *ClusterPipeline) SetBit(key string, offset int64, value int) *IntCmd
- func (c *ClusterPipeline) SetNX(key, value string, expiration time.Duration) *BoolCmd
- func (c *ClusterPipeline) SetRange(key string, offset int64, value string) *IntCmd
- func (c *ClusterPipeline) Shutdown() *StatusCmd
- func (c *ClusterPipeline) ShutdownNoSave() *StatusCmd
- func (c *ClusterPipeline) ShutdownSave() *StatusCmd
- func (c *ClusterPipeline) SlaveOf(host, port string) *StatusCmd
- func (c *ClusterPipeline) SlowLog()
- func (c *ClusterPipeline) Sort(key string, sort Sort) *StringSliceCmd
- func (c *ClusterPipeline) StrLen(key string) *IntCmd
- func (c *ClusterPipeline) Sync()
- func (c *ClusterPipeline) TTL(key string) *DurationCmd
- func (c *ClusterPipeline) Time() *StringSliceCmd
- func (c *ClusterPipeline) Type(key string) *StatusCmd
- func (c *ClusterPipeline) ZAdd(key string, members ...Z) *IntCmd
- func (c *ClusterPipeline) ZCard(key string) *IntCmd
- func (c *ClusterPipeline) ZCount(key, min, max string) *IntCmd
- func (c *ClusterPipeline) ZIncrBy(key string, increment float64, member string) *FloatCmd
- func (c *ClusterPipeline) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd
- func (c *ClusterPipeline) ZRange(key string, start, stop int64) *StringSliceCmd
- func (c *ClusterPipeline) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *ClusterPipeline) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *ClusterPipeline) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *ClusterPipeline) ZRank(key, member string) *IntCmd
- func (c *ClusterPipeline) ZRem(key string, members ...string) *IntCmd
- func (c *ClusterPipeline) ZRemRangeByRank(key string, start, stop int64) *IntCmd
- func (c *ClusterPipeline) ZRemRangeByScore(key, min, max string) *IntCmd
- func (c *ClusterPipeline) ZRevRange(key string, start, stop int64) *StringSliceCmd
- func (c *ClusterPipeline) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *ClusterPipeline) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *ClusterPipeline) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *ClusterPipeline) ZRevRank(key, member string) *IntCmd
- func (c *ClusterPipeline) ZScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *ClusterPipeline) ZScore(key, member string) *FloatCmd
- func (c *ClusterPipeline) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd
- type ClusterSlotCmd
- type ClusterSlotInfo
- type Cmd
- type Cmder
- type DurationCmd
- type FailoverOptions
- type FloatCmd
- type IntCmd
- type Message
- type Multi
- func (c *Multi) Append(key, value string) *IntCmd
- func (c *Multi) Auth(password string) *StatusCmd
- func (c *Multi) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *Multi) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *Multi) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd
- func (c *Multi) BgRewriteAOF() *StatusCmd
- func (c *Multi) BgSave() *StatusCmd
- func (c *Multi) BitCount(key string, bitCount *BitCount) *IntCmd
- func (c *Multi) BitOpAnd(destKey string, keys ...string) *IntCmd
- func (c *Multi) BitOpNot(destKey string, key string) *IntCmd
- func (c *Multi) BitOpOr(destKey string, keys ...string) *IntCmd
- func (c *Multi) BitOpXor(destKey string, keys ...string) *IntCmd
- func (c *Multi) BitPos(key string, bit int64, pos ...int64) *IntCmd
- func (c *Multi) ClientKill(ipPort string) *StatusCmd
- func (c *Multi) ClientList() *StringCmd
- func (c *Multi) ClientPause(dur time.Duration) *BoolCmd
- func (c *Multi) Close() error
- func (c *Multi) ClusterAddSlots(slots ...int) *StatusCmd
- func (c *Multi) ClusterAddSlotsRange(min, max int) *StatusCmd
- func (c *Multi) ClusterFailover() *StatusCmd
- func (c *Multi) ClusterInfo() *StringCmd
- func (c *Multi) ClusterMeet(host, port string) *StatusCmd
- func (c *Multi) ClusterNodes() *StringCmd
- func (c *Multi) ClusterReplicate(nodeID string) *StatusCmd
- func (c *Multi) ClusterSlots() *ClusterSlotCmd
- func (c *Multi) ConfigGet(parameter string) *SliceCmd
- func (c *Multi) ConfigResetStat() *StatusCmd
- func (c *Multi) ConfigSet(parameter, value string) *StatusCmd
- func (c *Multi) DbSize() *IntCmd
- func (c *Multi) DebugObject(key string) *StringCmd
- func (c *Multi) Decr(key string) *IntCmd
- func (c *Multi) DecrBy(key string, decrement int64) *IntCmd
- func (c *Multi) Del(keys ...string) *IntCmd
- func (c *Multi) Discard() error
- func (c *Multi) Dump(key string) *StringCmd
- func (c *Multi) Echo(message string) *StringCmd
- func (c *Multi) Eval(script string, keys []string, args []string) *Cmd
- func (c *Multi) EvalSha(sha1 string, keys []string, args []string) *Cmd
- func (c *Multi) Exec(f func() error) ([]Cmder, error)
- func (c *Multi) Exists(key string) *BoolCmd
- func (c *Multi) Expire(key string, expiration time.Duration) *BoolCmd
- func (c *Multi) ExpireAt(key string, tm time.Time) *BoolCmd
- func (c *Multi) FlushAll() *StatusCmd
- func (c *Multi) FlushDb() *StatusCmd
- func (c *Multi) Get(key string) *StringCmd
- func (c *Multi) GetBit(key string, offset int64) *IntCmd
- func (c *Multi) GetRange(key string, start, end int64) *StringCmd
- func (c *Multi) GetSet(key, value string) *StringCmd
- func (c *Multi) HDel(key string, fields ...string) *IntCmd
- func (c *Multi) HExists(key, field string) *BoolCmd
- func (c *Multi) HGet(key, field string) *StringCmd
- func (c *Multi) HGetAll(key string) *StringSliceCmd
- func (c *Multi) HGetAllMap(key string) *StringStringMapCmd
- func (c *Multi) HIncrBy(key, field string, incr int64) *IntCmd
- func (c *Multi) HIncrByFloat(key, field string, incr float64) *FloatCmd
- func (c *Multi) HKeys(key string) *StringSliceCmd
- func (c *Multi) HLen(key string) *IntCmd
- func (c *Multi) HMGet(key string, fields ...string) *SliceCmd
- func (c *Multi) HMSet(key, field, value string, pairs ...string) *StatusCmd
- func (c *Multi) HScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Multi) HSet(key, field, value string) *BoolCmd
- func (c *Multi) HSetNX(key, field, value string) *BoolCmd
- func (c *Multi) HVals(key string) *StringSliceCmd
- func (c *Multi) Incr(key string) *IntCmd
- func (c *Multi) IncrBy(key string, value int64) *IntCmd
- func (c *Multi) IncrByFloat(key string, value float64) *FloatCmd
- func (c *Multi) Info() *StringCmd
- func (c *Multi) Keys(pattern string) *StringSliceCmd
- func (c *Multi) LIndex(key string, index int64) *StringCmd
- func (c *Multi) LInsert(key, op, pivot, value string) *IntCmd
- func (c *Multi) LLen(key string) *IntCmd
- func (c *Multi) LPop(key string) *StringCmd
- func (c *Multi) LPush(key string, values ...string) *IntCmd
- func (c *Multi) LPushX(key, value string) *IntCmd
- func (c *Multi) LRange(key string, start, stop int64) *StringSliceCmd
- func (c *Multi) LRem(key string, count int64, value string) *IntCmd
- func (c *Multi) LSet(key string, index int64, value string) *StatusCmd
- func (c *Multi) LTrim(key string, start, stop int64) *StatusCmd
- func (c *Multi) LastSave() *IntCmd
- func (c *Multi) MGet(keys ...string) *SliceCmd
- func (c *Multi) MSet(pairs ...string) *StatusCmd
- func (c *Multi) MSetNX(pairs ...string) *BoolCmd
- func (c *Multi) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd
- func (c *Multi) Move(key string, db int64) *BoolCmd
- func (c *Multi) ObjectEncoding(keys ...string) *StringCmd
- func (c *Multi) ObjectIdleTime(keys ...string) *DurationCmd
- func (c *Multi) ObjectRefCount(keys ...string) *IntCmd
- func (c *Multi) PExpire(key string, expiration time.Duration) *BoolCmd
- func (c *Multi) PExpireAt(key string, tm time.Time) *BoolCmd
- func (c *Multi) PTTL(key string) *DurationCmd
- func (c *Multi) Persist(key string) *BoolCmd
- func (c *Multi) Ping() *StatusCmd
- func (c *Multi) Process(cmd Cmder)
- func (c *Multi) PubSubChannels(pattern string) *StringSliceCmd
- func (c *Multi) PubSubNumPat() *IntCmd
- func (c *Multi) PubSubNumSub(channels ...string) *StringIntMapCmd
- func (c *Multi) Quit() *StatusCmd
- func (c *Multi) RPop(key string) *StringCmd
- func (c *Multi) RPopLPush(source, destination string) *StringCmd
- func (c *Multi) RPush(key string, values ...string) *IntCmd
- func (c *Multi) RPushX(key string, value string) *IntCmd
- func (c *Multi) RandomKey() *StringCmd
- func (c *Multi) Rename(key, newkey string) *StatusCmd
- func (c *Multi) RenameNX(key, newkey string) *BoolCmd
- func (c *Multi) Restore(key string, ttl int64, value string) *StatusCmd
- func (c *Multi) SAdd(key string, members ...string) *IntCmd
- func (c *Multi) SCard(key string) *IntCmd
- func (c *Multi) SDiff(keys ...string) *StringSliceCmd
- func (c *Multi) SDiffStore(destination string, keys ...string) *IntCmd
- func (c *Multi) SInter(keys ...string) *StringSliceCmd
- func (c *Multi) SInterStore(destination string, keys ...string) *IntCmd
- func (c *Multi) SIsMember(key, member string) *BoolCmd
- func (c *Multi) SMembers(key string) *StringSliceCmd
- func (c *Multi) SMove(source, destination, member string) *BoolCmd
- func (c *Multi) SPop(key string) *StringCmd
- func (c *Multi) SRandMember(key string) *StringCmd
- func (c *Multi) SRem(key string, members ...string) *IntCmd
- func (c *Multi) SScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Multi) SUnion(keys ...string) *StringSliceCmd
- func (c *Multi) SUnionStore(destination string, keys ...string) *IntCmd
- func (c *Multi) Save() *StatusCmd
- func (c *Multi) Scan(cursor int64, match string, count int64) *ScanCmd
- func (c *Multi) ScriptExists(scripts ...string) *BoolSliceCmd
- func (c *Multi) ScriptFlush() *StatusCmd
- func (c *Multi) ScriptKill() *StatusCmd
- func (c *Multi) ScriptLoad(script string) *StringCmd
- func (c *Multi) Select(index int64) *StatusCmd
- func (c *Multi) Set(key, value string, expiration time.Duration) *StatusCmd
- func (c *Multi) SetBit(key string, offset int64, value int) *IntCmd
- func (c *Multi) SetNX(key, value string, expiration time.Duration) *BoolCmd
- func (c *Multi) SetRange(key string, offset int64, value string) *IntCmd
- func (c *Multi) Shutdown() *StatusCmd
- func (c *Multi) ShutdownNoSave() *StatusCmd
- func (c *Multi) ShutdownSave() *StatusCmd
- func (c *Multi) SlaveOf(host, port string) *StatusCmd
- func (c *Multi) SlowLog()
- func (c *Multi) Sort(key string, sort Sort) *StringSliceCmd
- func (c *Multi) StrLen(key string) *IntCmd
- func (c *Multi) Sync()
- func (c *Multi) TTL(key string) *DurationCmd
- func (c *Multi) Time() *StringSliceCmd
- func (c *Multi) Type(key string) *StatusCmd
- func (c *Multi) Unwatch(keys ...string) *StatusCmd
- func (c *Multi) Watch(keys ...string) *StatusCmd
- func (c *Multi) ZAdd(key string, members ...Z) *IntCmd
- func (c *Multi) ZCard(key string) *IntCmd
- func (c *Multi) ZCount(key, min, max string) *IntCmd
- func (c *Multi) ZIncrBy(key string, increment float64, member string) *FloatCmd
- func (c *Multi) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd
- func (c *Multi) ZRange(key string, start, stop int64) *StringSliceCmd
- func (c *Multi) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *Multi) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *Multi) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *Multi) ZRank(key, member string) *IntCmd
- func (c *Multi) ZRem(key string, members ...string) *IntCmd
- func (c *Multi) ZRemRangeByRank(key string, start, stop int64) *IntCmd
- func (c *Multi) ZRemRangeByScore(key, min, max string) *IntCmd
- func (c *Multi) ZRevRange(key string, start, stop int64) *StringSliceCmd
- func (c *Multi) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *Multi) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *Multi) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *Multi) ZRevRank(key, member string) *IntCmd
- func (c *Multi) ZScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Multi) ZScore(key, member string) *FloatCmd
- func (c *Multi) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd
- type Options
- type PMessage
- type Pipeline
- func (c *Pipeline) Append(key, value string) *IntCmd
- func (c *Pipeline) Auth(password string) *StatusCmd
- func (c *Pipeline) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *Pipeline) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *Pipeline) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd
- func (c *Pipeline) BgRewriteAOF() *StatusCmd
- func (c *Pipeline) BgSave() *StatusCmd
- func (c *Pipeline) BitCount(key string, bitCount *BitCount) *IntCmd
- func (c *Pipeline) BitOpAnd(destKey string, keys ...string) *IntCmd
- func (c *Pipeline) BitOpNot(destKey string, key string) *IntCmd
- func (c *Pipeline) BitOpOr(destKey string, keys ...string) *IntCmd
- func (c *Pipeline) BitOpXor(destKey string, keys ...string) *IntCmd
- func (c *Pipeline) BitPos(key string, bit int64, pos ...int64) *IntCmd
- func (c *Pipeline) ClientKill(ipPort string) *StatusCmd
- func (c *Pipeline) ClientList() *StringCmd
- func (c *Pipeline) ClientPause(dur time.Duration) *BoolCmd
- func (pipe *Pipeline) Close() error
- func (c *Pipeline) ClusterAddSlots(slots ...int) *StatusCmd
- func (c *Pipeline) ClusterAddSlotsRange(min, max int) *StatusCmd
- func (c *Pipeline) ClusterFailover() *StatusCmd
- func (c *Pipeline) ClusterInfo() *StringCmd
- func (c *Pipeline) ClusterMeet(host, port string) *StatusCmd
- func (c *Pipeline) ClusterNodes() *StringCmd
- func (c *Pipeline) ClusterReplicate(nodeID string) *StatusCmd
- func (c *Pipeline) ClusterSlots() *ClusterSlotCmd
- func (c *Pipeline) ConfigGet(parameter string) *SliceCmd
- func (c *Pipeline) ConfigResetStat() *StatusCmd
- func (c *Pipeline) ConfigSet(parameter, value string) *StatusCmd
- func (c *Pipeline) DbSize() *IntCmd
- func (c *Pipeline) DebugObject(key string) *StringCmd
- func (c *Pipeline) Decr(key string) *IntCmd
- func (c *Pipeline) DecrBy(key string, decrement int64) *IntCmd
- func (c *Pipeline) Del(keys ...string) *IntCmd
- func (pipe *Pipeline) Discard() error
- func (c *Pipeline) Dump(key string) *StringCmd
- func (c *Pipeline) Echo(message string) *StringCmd
- func (c *Pipeline) Eval(script string, keys []string, args []string) *Cmd
- func (c *Pipeline) EvalSha(sha1 string, keys []string, args []string) *Cmd
- func (pipe *Pipeline) Exec() (cmds []Cmder, retErr error)
- func (c *Pipeline) Exists(key string) *BoolCmd
- func (c *Pipeline) Expire(key string, expiration time.Duration) *BoolCmd
- func (c *Pipeline) ExpireAt(key string, tm time.Time) *BoolCmd
- func (c *Pipeline) FlushAll() *StatusCmd
- func (c *Pipeline) FlushDb() *StatusCmd
- func (c *Pipeline) Get(key string) *StringCmd
- func (c *Pipeline) GetBit(key string, offset int64) *IntCmd
- func (c *Pipeline) GetRange(key string, start, end int64) *StringCmd
- func (c *Pipeline) GetSet(key, value string) *StringCmd
- func (c *Pipeline) HDel(key string, fields ...string) *IntCmd
- func (c *Pipeline) HExists(key, field string) *BoolCmd
- func (c *Pipeline) HGet(key, field string) *StringCmd
- func (c *Pipeline) HGetAll(key string) *StringSliceCmd
- func (c *Pipeline) HGetAllMap(key string) *StringStringMapCmd
- func (c *Pipeline) HIncrBy(key, field string, incr int64) *IntCmd
- func (c *Pipeline) HIncrByFloat(key, field string, incr float64) *FloatCmd
- func (c *Pipeline) HKeys(key string) *StringSliceCmd
- func (c *Pipeline) HLen(key string) *IntCmd
- func (c *Pipeline) HMGet(key string, fields ...string) *SliceCmd
- func (c *Pipeline) HMSet(key, field, value string, pairs ...string) *StatusCmd
- func (c *Pipeline) HScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Pipeline) HSet(key, field, value string) *BoolCmd
- func (c *Pipeline) HSetNX(key, field, value string) *BoolCmd
- func (c *Pipeline) HVals(key string) *StringSliceCmd
- func (c *Pipeline) Incr(key string) *IntCmd
- func (c *Pipeline) IncrBy(key string, value int64) *IntCmd
- func (c *Pipeline) IncrByFloat(key string, value float64) *FloatCmd
- func (c *Pipeline) Info() *StringCmd
- func (c *Pipeline) Keys(pattern string) *StringSliceCmd
- func (c *Pipeline) LIndex(key string, index int64) *StringCmd
- func (c *Pipeline) LInsert(key, op, pivot, value string) *IntCmd
- func (c *Pipeline) LLen(key string) *IntCmd
- func (c *Pipeline) LPop(key string) *StringCmd
- func (c *Pipeline) LPush(key string, values ...string) *IntCmd
- func (c *Pipeline) LPushX(key, value string) *IntCmd
- func (c *Pipeline) LRange(key string, start, stop int64) *StringSliceCmd
- func (c *Pipeline) LRem(key string, count int64, value string) *IntCmd
- func (c *Pipeline) LSet(key string, index int64, value string) *StatusCmd
- func (c *Pipeline) LTrim(key string, start, stop int64) *StatusCmd
- func (c *Pipeline) LastSave() *IntCmd
- func (c *Pipeline) MGet(keys ...string) *SliceCmd
- func (c *Pipeline) MSet(pairs ...string) *StatusCmd
- func (c *Pipeline) MSetNX(pairs ...string) *BoolCmd
- func (c *Pipeline) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd
- func (c *Pipeline) Move(key string, db int64) *BoolCmd
- func (c *Pipeline) ObjectEncoding(keys ...string) *StringCmd
- func (c *Pipeline) ObjectIdleTime(keys ...string) *DurationCmd
- func (c *Pipeline) ObjectRefCount(keys ...string) *IntCmd
- func (c *Pipeline) PExpire(key string, expiration time.Duration) *BoolCmd
- func (c *Pipeline) PExpireAt(key string, tm time.Time) *BoolCmd
- func (c *Pipeline) PTTL(key string) *DurationCmd
- func (c *Pipeline) Persist(key string) *BoolCmd
- func (c *Pipeline) Ping() *StatusCmd
- func (c *Pipeline) Process(cmd Cmder)
- func (c *Pipeline) PubSubChannels(pattern string) *StringSliceCmd
- func (c *Pipeline) PubSubNumPat() *IntCmd
- func (c *Pipeline) PubSubNumSub(channels ...string) *StringIntMapCmd
- func (c *Pipeline) Quit() *StatusCmd
- func (c *Pipeline) RPop(key string) *StringCmd
- func (c *Pipeline) RPopLPush(source, destination string) *StringCmd
- func (c *Pipeline) RPush(key string, values ...string) *IntCmd
- func (c *Pipeline) RPushX(key string, value string) *IntCmd
- func (c *Pipeline) RandomKey() *StringCmd
- func (c *Pipeline) Rename(key, newkey string) *StatusCmd
- func (c *Pipeline) RenameNX(key, newkey string) *BoolCmd
- func (c *Pipeline) Restore(key string, ttl int64, value string) *StatusCmd
- func (c *Pipeline) SAdd(key string, members ...string) *IntCmd
- func (c *Pipeline) SCard(key string) *IntCmd
- func (c *Pipeline) SDiff(keys ...string) *StringSliceCmd
- func (c *Pipeline) SDiffStore(destination string, keys ...string) *IntCmd
- func (c *Pipeline) SInter(keys ...string) *StringSliceCmd
- func (c *Pipeline) SInterStore(destination string, keys ...string) *IntCmd
- func (c *Pipeline) SIsMember(key, member string) *BoolCmd
- func (c *Pipeline) SMembers(key string) *StringSliceCmd
- func (c *Pipeline) SMove(source, destination, member string) *BoolCmd
- func (c *Pipeline) SPop(key string) *StringCmd
- func (c *Pipeline) SRandMember(key string) *StringCmd
- func (c *Pipeline) SRem(key string, members ...string) *IntCmd
- func (c *Pipeline) SScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Pipeline) SUnion(keys ...string) *StringSliceCmd
- func (c *Pipeline) SUnionStore(destination string, keys ...string) *IntCmd
- func (c *Pipeline) Save() *StatusCmd
- func (c *Pipeline) Scan(cursor int64, match string, count int64) *ScanCmd
- func (c *Pipeline) ScriptExists(scripts ...string) *BoolSliceCmd
- func (c *Pipeline) ScriptFlush() *StatusCmd
- func (c *Pipeline) ScriptKill() *StatusCmd
- func (c *Pipeline) ScriptLoad(script string) *StringCmd
- func (c *Pipeline) Select(index int64) *StatusCmd
- func (c *Pipeline) Set(key, value string, expiration time.Duration) *StatusCmd
- func (c *Pipeline) SetBit(key string, offset int64, value int) *IntCmd
- func (c *Pipeline) SetNX(key, value string, expiration time.Duration) *BoolCmd
- func (c *Pipeline) SetRange(key string, offset int64, value string) *IntCmd
- func (c *Pipeline) Shutdown() *StatusCmd
- func (c *Pipeline) ShutdownNoSave() *StatusCmd
- func (c *Pipeline) ShutdownSave() *StatusCmd
- func (c *Pipeline) SlaveOf(host, port string) *StatusCmd
- func (c *Pipeline) SlowLog()
- func (c *Pipeline) Sort(key string, sort Sort) *StringSliceCmd
- func (c *Pipeline) StrLen(key string) *IntCmd
- func (c *Pipeline) Sync()
- func (c *Pipeline) TTL(key string) *DurationCmd
- func (c *Pipeline) Time() *StringSliceCmd
- func (c *Pipeline) Type(key string) *StatusCmd
- func (c *Pipeline) ZAdd(key string, members ...Z) *IntCmd
- func (c *Pipeline) ZCard(key string) *IntCmd
- func (c *Pipeline) ZCount(key, min, max string) *IntCmd
- func (c *Pipeline) ZIncrBy(key string, increment float64, member string) *FloatCmd
- func (c *Pipeline) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd
- func (c *Pipeline) ZRange(key string, start, stop int64) *StringSliceCmd
- func (c *Pipeline) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *Pipeline) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *Pipeline) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *Pipeline) ZRank(key, member string) *IntCmd
- func (c *Pipeline) ZRem(key string, members ...string) *IntCmd
- func (c *Pipeline) ZRemRangeByRank(key string, start, stop int64) *IntCmd
- func (c *Pipeline) ZRemRangeByScore(key, min, max string) *IntCmd
- func (c *Pipeline) ZRevRange(key string, start, stop int64) *StringSliceCmd
- func (c *Pipeline) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *Pipeline) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *Pipeline) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *Pipeline) ZRevRank(key, member string) *IntCmd
- func (c *Pipeline) ZScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Pipeline) ZScore(key, member string) *FloatCmd
- func (c *Pipeline) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd
- type PubSub
- func (c PubSub) Close() error
- func (c *PubSub) PSubscribe(patterns ...string) error
- func (c *PubSub) PUnsubscribe(patterns ...string) error
- func (c *PubSub) Receive() (interface{}, error)
- func (c *PubSub) ReceiveTimeout(timeout time.Duration) (interface{}, error)
- func (c PubSub) String() string
- func (c *PubSub) Subscribe(channels ...string) error
- func (c *PubSub) Unsubscribe(channels ...string) error
- type Ring
- func (c *Ring) Append(key, value string) *IntCmd
- func (c *Ring) Auth(password string) *StatusCmd
- func (c *Ring) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *Ring) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *Ring) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd
- func (c *Ring) BgRewriteAOF() *StatusCmd
- func (c *Ring) BgSave() *StatusCmd
- func (c *Ring) BitCount(key string, bitCount *BitCount) *IntCmd
- func (c *Ring) BitOpAnd(destKey string, keys ...string) *IntCmd
- func (c *Ring) BitOpNot(destKey string, key string) *IntCmd
- func (c *Ring) BitOpOr(destKey string, keys ...string) *IntCmd
- func (c *Ring) BitOpXor(destKey string, keys ...string) *IntCmd
- func (c *Ring) BitPos(key string, bit int64, pos ...int64) *IntCmd
- func (c *Ring) ClientKill(ipPort string) *StatusCmd
- func (c *Ring) ClientList() *StringCmd
- func (c *Ring) ClientPause(dur time.Duration) *BoolCmd
- func (ring *Ring) Close() (retErr error)
- func (c *Ring) ClusterAddSlots(slots ...int) *StatusCmd
- func (c *Ring) ClusterAddSlotsRange(min, max int) *StatusCmd
- func (c *Ring) ClusterFailover() *StatusCmd
- func (c *Ring) ClusterInfo() *StringCmd
- func (c *Ring) ClusterMeet(host, port string) *StatusCmd
- func (c *Ring) ClusterNodes() *StringCmd
- func (c *Ring) ClusterReplicate(nodeID string) *StatusCmd
- func (c *Ring) ClusterSlots() *ClusterSlotCmd
- func (c *Ring) ConfigGet(parameter string) *SliceCmd
- func (c *Ring) ConfigResetStat() *StatusCmd
- func (c *Ring) ConfigSet(parameter, value string) *StatusCmd
- func (c *Ring) DbSize() *IntCmd
- func (c *Ring) DebugObject(key string) *StringCmd
- func (c *Ring) Decr(key string) *IntCmd
- func (c *Ring) DecrBy(key string, decrement int64) *IntCmd
- func (c *Ring) Del(keys ...string) *IntCmd
- func (c *Ring) Dump(key string) *StringCmd
- func (c *Ring) Echo(message string) *StringCmd
- func (c *Ring) Eval(script string, keys []string, args []string) *Cmd
- func (c *Ring) EvalSha(sha1 string, keys []string, args []string) *Cmd
- func (c *Ring) Exists(key string) *BoolCmd
- func (c *Ring) Expire(key string, expiration time.Duration) *BoolCmd
- func (c *Ring) ExpireAt(key string, tm time.Time) *BoolCmd
- func (c *Ring) FlushAll() *StatusCmd
- func (c *Ring) FlushDb() *StatusCmd
- func (c *Ring) Get(key string) *StringCmd
- func (c *Ring) GetBit(key string, offset int64) *IntCmd
- func (c *Ring) GetRange(key string, start, end int64) *StringCmd
- func (c *Ring) GetSet(key, value string) *StringCmd
- func (c *Ring) HDel(key string, fields ...string) *IntCmd
- func (c *Ring) HExists(key, field string) *BoolCmd
- func (c *Ring) HGet(key, field string) *StringCmd
- func (c *Ring) HGetAll(key string) *StringSliceCmd
- func (c *Ring) HGetAllMap(key string) *StringStringMapCmd
- func (c *Ring) HIncrBy(key, field string, incr int64) *IntCmd
- func (c *Ring) HIncrByFloat(key, field string, incr float64) *FloatCmd
- func (c *Ring) HKeys(key string) *StringSliceCmd
- func (c *Ring) HLen(key string) *IntCmd
- func (c *Ring) HMGet(key string, fields ...string) *SliceCmd
- func (c *Ring) HMSet(key, field, value string, pairs ...string) *StatusCmd
- func (c *Ring) HScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Ring) HSet(key, field, value string) *BoolCmd
- func (c *Ring) HSetNX(key, field, value string) *BoolCmd
- func (c *Ring) HVals(key string) *StringSliceCmd
- func (c *Ring) Incr(key string) *IntCmd
- func (c *Ring) IncrBy(key string, value int64) *IntCmd
- func (c *Ring) IncrByFloat(key string, value float64) *FloatCmd
- func (c *Ring) Info() *StringCmd
- func (c *Ring) Keys(pattern string) *StringSliceCmd
- func (c *Ring) LIndex(key string, index int64) *StringCmd
- func (c *Ring) LInsert(key, op, pivot, value string) *IntCmd
- func (c *Ring) LLen(key string) *IntCmd
- func (c *Ring) LPop(key string) *StringCmd
- func (c *Ring) LPush(key string, values ...string) *IntCmd
- func (c *Ring) LPushX(key, value string) *IntCmd
- func (c *Ring) LRange(key string, start, stop int64) *StringSliceCmd
- func (c *Ring) LRem(key string, count int64, value string) *IntCmd
- func (c *Ring) LSet(key string, index int64, value string) *StatusCmd
- func (c *Ring) LTrim(key string, start, stop int64) *StatusCmd
- func (c *Ring) LastSave() *IntCmd
- func (c *Ring) MGet(keys ...string) *SliceCmd
- func (c *Ring) MSet(pairs ...string) *StatusCmd
- func (c *Ring) MSetNX(pairs ...string) *BoolCmd
- func (c *Ring) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd
- func (c *Ring) Move(key string, db int64) *BoolCmd
- func (c *Ring) ObjectEncoding(keys ...string) *StringCmd
- func (c *Ring) ObjectIdleTime(keys ...string) *DurationCmd
- func (c *Ring) ObjectRefCount(keys ...string) *IntCmd
- func (c *Ring) PExpire(key string, expiration time.Duration) *BoolCmd
- func (c *Ring) PExpireAt(key string, tm time.Time) *BoolCmd
- func (c *Ring) PTTL(key string) *DurationCmd
- func (c *Ring) Persist(key string) *BoolCmd
- func (c *Ring) Ping() *StatusCmd
- func (ring *Ring) Pipeline() *RingPipeline
- func (ring *Ring) Pipelined(fn func(*RingPipeline) error) ([]Cmder, error)
- func (c *Ring) Process(cmd Cmder)
- func (c *Ring) PubSubChannels(pattern string) *StringSliceCmd
- func (c *Ring) PubSubNumPat() *IntCmd
- func (c *Ring) PubSubNumSub(channels ...string) *StringIntMapCmd
- func (c *Ring) Quit() *StatusCmd
- func (c *Ring) RPop(key string) *StringCmd
- func (c *Ring) RPopLPush(source, destination string) *StringCmd
- func (c *Ring) RPush(key string, values ...string) *IntCmd
- func (c *Ring) RPushX(key string, value string) *IntCmd
- func (c *Ring) RandomKey() *StringCmd
- func (c *Ring) Rename(key, newkey string) *StatusCmd
- func (c *Ring) RenameNX(key, newkey string) *BoolCmd
- func (c *Ring) Restore(key string, ttl int64, value string) *StatusCmd
- func (c *Ring) SAdd(key string, members ...string) *IntCmd
- func (c *Ring) SCard(key string) *IntCmd
- func (c *Ring) SDiff(keys ...string) *StringSliceCmd
- func (c *Ring) SDiffStore(destination string, keys ...string) *IntCmd
- func (c *Ring) SInter(keys ...string) *StringSliceCmd
- func (c *Ring) SInterStore(destination string, keys ...string) *IntCmd
- func (c *Ring) SIsMember(key, member string) *BoolCmd
- func (c *Ring) SMembers(key string) *StringSliceCmd
- func (c *Ring) SMove(source, destination, member string) *BoolCmd
- func (c *Ring) SPop(key string) *StringCmd
- func (c *Ring) SRandMember(key string) *StringCmd
- func (c *Ring) SRem(key string, members ...string) *IntCmd
- func (c *Ring) SScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Ring) SUnion(keys ...string) *StringSliceCmd
- func (c *Ring) SUnionStore(destination string, keys ...string) *IntCmd
- func (c *Ring) Save() *StatusCmd
- func (c *Ring) Scan(cursor int64, match string, count int64) *ScanCmd
- func (c *Ring) ScriptExists(scripts ...string) *BoolSliceCmd
- func (c *Ring) ScriptFlush() *StatusCmd
- func (c *Ring) ScriptKill() *StatusCmd
- func (c *Ring) ScriptLoad(script string) *StringCmd
- func (c *Ring) Select(index int64) *StatusCmd
- func (c *Ring) Set(key, value string, expiration time.Duration) *StatusCmd
- func (c *Ring) SetBit(key string, offset int64, value int) *IntCmd
- func (c *Ring) SetNX(key, value string, expiration time.Duration) *BoolCmd
- func (c *Ring) SetRange(key string, offset int64, value string) *IntCmd
- func (c *Ring) Shutdown() *StatusCmd
- func (c *Ring) ShutdownNoSave() *StatusCmd
- func (c *Ring) ShutdownSave() *StatusCmd
- func (c *Ring) SlaveOf(host, port string) *StatusCmd
- func (c *Ring) SlowLog()
- func (c *Ring) Sort(key string, sort Sort) *StringSliceCmd
- func (c *Ring) StrLen(key string) *IntCmd
- func (c *Ring) Sync()
- func (c *Ring) TTL(key string) *DurationCmd
- func (c *Ring) Time() *StringSliceCmd
- func (c *Ring) Type(key string) *StatusCmd
- func (c *Ring) ZAdd(key string, members ...Z) *IntCmd
- func (c *Ring) ZCard(key string) *IntCmd
- func (c *Ring) ZCount(key, min, max string) *IntCmd
- func (c *Ring) ZIncrBy(key string, increment float64, member string) *FloatCmd
- func (c *Ring) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd
- func (c *Ring) ZRange(key string, start, stop int64) *StringSliceCmd
- func (c *Ring) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *Ring) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *Ring) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *Ring) ZRank(key, member string) *IntCmd
- func (c *Ring) ZRem(key string, members ...string) *IntCmd
- func (c *Ring) ZRemRangeByRank(key string, start, stop int64) *IntCmd
- func (c *Ring) ZRemRangeByScore(key, min, max string) *IntCmd
- func (c *Ring) ZRevRange(key string, start, stop int64) *StringSliceCmd
- func (c *Ring) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *Ring) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *Ring) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *Ring) ZRevRank(key, member string) *IntCmd
- func (c *Ring) ZScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *Ring) ZScore(key, member string) *FloatCmd
- func (c *Ring) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd
- type RingOptions
- type RingPipeline
- func (c *RingPipeline) Append(key, value string) *IntCmd
- func (c *RingPipeline) Auth(password string) *StatusCmd
- func (c *RingPipeline) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *RingPipeline) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
- func (c *RingPipeline) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd
- func (c *RingPipeline) BgRewriteAOF() *StatusCmd
- func (c *RingPipeline) BgSave() *StatusCmd
- func (c *RingPipeline) BitCount(key string, bitCount *BitCount) *IntCmd
- func (c *RingPipeline) BitOpAnd(destKey string, keys ...string) *IntCmd
- func (c *RingPipeline) BitOpNot(destKey string, key string) *IntCmd
- func (c *RingPipeline) BitOpOr(destKey string, keys ...string) *IntCmd
- func (c *RingPipeline) BitOpXor(destKey string, keys ...string) *IntCmd
- func (c *RingPipeline) BitPos(key string, bit int64, pos ...int64) *IntCmd
- func (c *RingPipeline) ClientKill(ipPort string) *StatusCmd
- func (c *RingPipeline) ClientList() *StringCmd
- func (c *RingPipeline) ClientPause(dur time.Duration) *BoolCmd
- func (pipe *RingPipeline) Close() error
- func (c *RingPipeline) ClusterAddSlots(slots ...int) *StatusCmd
- func (c *RingPipeline) ClusterAddSlotsRange(min, max int) *StatusCmd
- func (c *RingPipeline) ClusterFailover() *StatusCmd
- func (c *RingPipeline) ClusterInfo() *StringCmd
- func (c *RingPipeline) ClusterMeet(host, port string) *StatusCmd
- func (c *RingPipeline) ClusterNodes() *StringCmd
- func (c *RingPipeline) ClusterReplicate(nodeID string) *StatusCmd
- func (c *RingPipeline) ClusterSlots() *ClusterSlotCmd
- func (c *RingPipeline) ConfigGet(parameter string) *SliceCmd
- func (c *RingPipeline) ConfigResetStat() *StatusCmd
- func (c *RingPipeline) ConfigSet(parameter, value string) *StatusCmd
- func (c *RingPipeline) DbSize() *IntCmd
- func (c *RingPipeline) DebugObject(key string) *StringCmd
- func (c *RingPipeline) Decr(key string) *IntCmd
- func (c *RingPipeline) DecrBy(key string, decrement int64) *IntCmd
- func (c *RingPipeline) Del(keys ...string) *IntCmd
- func (pipe *RingPipeline) Discard() error
- func (c *RingPipeline) Dump(key string) *StringCmd
- func (c *RingPipeline) Echo(message string) *StringCmd
- func (c *RingPipeline) Eval(script string, keys []string, args []string) *Cmd
- func (c *RingPipeline) EvalSha(sha1 string, keys []string, args []string) *Cmd
- func (pipe *RingPipeline) Exec() (cmds []Cmder, retErr error)
- func (c *RingPipeline) Exists(key string) *BoolCmd
- func (c *RingPipeline) Expire(key string, expiration time.Duration) *BoolCmd
- func (c *RingPipeline) ExpireAt(key string, tm time.Time) *BoolCmd
- func (c *RingPipeline) FlushAll() *StatusCmd
- func (c *RingPipeline) FlushDb() *StatusCmd
- func (c *RingPipeline) Get(key string) *StringCmd
- func (c *RingPipeline) GetBit(key string, offset int64) *IntCmd
- func (c *RingPipeline) GetRange(key string, start, end int64) *StringCmd
- func (c *RingPipeline) GetSet(key, value string) *StringCmd
- func (c *RingPipeline) HDel(key string, fields ...string) *IntCmd
- func (c *RingPipeline) HExists(key, field string) *BoolCmd
- func (c *RingPipeline) HGet(key, field string) *StringCmd
- func (c *RingPipeline) HGetAll(key string) *StringSliceCmd
- func (c *RingPipeline) HGetAllMap(key string) *StringStringMapCmd
- func (c *RingPipeline) HIncrBy(key, field string, incr int64) *IntCmd
- func (c *RingPipeline) HIncrByFloat(key, field string, incr float64) *FloatCmd
- func (c *RingPipeline) HKeys(key string) *StringSliceCmd
- func (c *RingPipeline) HLen(key string) *IntCmd
- func (c *RingPipeline) HMGet(key string, fields ...string) *SliceCmd
- func (c *RingPipeline) HMSet(key, field, value string, pairs ...string) *StatusCmd
- func (c *RingPipeline) HScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *RingPipeline) HSet(key, field, value string) *BoolCmd
- func (c *RingPipeline) HSetNX(key, field, value string) *BoolCmd
- func (c *RingPipeline) HVals(key string) *StringSliceCmd
- func (c *RingPipeline) Incr(key string) *IntCmd
- func (c *RingPipeline) IncrBy(key string, value int64) *IntCmd
- func (c *RingPipeline) IncrByFloat(key string, value float64) *FloatCmd
- func (c *RingPipeline) Info() *StringCmd
- func (c *RingPipeline) Keys(pattern string) *StringSliceCmd
- func (c *RingPipeline) LIndex(key string, index int64) *StringCmd
- func (c *RingPipeline) LInsert(key, op, pivot, value string) *IntCmd
- func (c *RingPipeline) LLen(key string) *IntCmd
- func (c *RingPipeline) LPop(key string) *StringCmd
- func (c *RingPipeline) LPush(key string, values ...string) *IntCmd
- func (c *RingPipeline) LPushX(key, value string) *IntCmd
- func (c *RingPipeline) LRange(key string, start, stop int64) *StringSliceCmd
- func (c *RingPipeline) LRem(key string, count int64, value string) *IntCmd
- func (c *RingPipeline) LSet(key string, index int64, value string) *StatusCmd
- func (c *RingPipeline) LTrim(key string, start, stop int64) *StatusCmd
- func (c *RingPipeline) LastSave() *IntCmd
- func (c *RingPipeline) MGet(keys ...string) *SliceCmd
- func (c *RingPipeline) MSet(pairs ...string) *StatusCmd
- func (c *RingPipeline) MSetNX(pairs ...string) *BoolCmd
- func (c *RingPipeline) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd
- func (c *RingPipeline) Move(key string, db int64) *BoolCmd
- func (c *RingPipeline) ObjectEncoding(keys ...string) *StringCmd
- func (c *RingPipeline) ObjectIdleTime(keys ...string) *DurationCmd
- func (c *RingPipeline) ObjectRefCount(keys ...string) *IntCmd
- func (c *RingPipeline) PExpire(key string, expiration time.Duration) *BoolCmd
- func (c *RingPipeline) PExpireAt(key string, tm time.Time) *BoolCmd
- func (c *RingPipeline) PTTL(key string) *DurationCmd
- func (c *RingPipeline) Persist(key string) *BoolCmd
- func (c *RingPipeline) Ping() *StatusCmd
- func (c *RingPipeline) Process(cmd Cmder)
- func (c *RingPipeline) PubSubChannels(pattern string) *StringSliceCmd
- func (c *RingPipeline) PubSubNumPat() *IntCmd
- func (c *RingPipeline) PubSubNumSub(channels ...string) *StringIntMapCmd
- func (c *RingPipeline) Quit() *StatusCmd
- func (c *RingPipeline) RPop(key string) *StringCmd
- func (c *RingPipeline) RPopLPush(source, destination string) *StringCmd
- func (c *RingPipeline) RPush(key string, values ...string) *IntCmd
- func (c *RingPipeline) RPushX(key string, value string) *IntCmd
- func (c *RingPipeline) RandomKey() *StringCmd
- func (c *RingPipeline) Rename(key, newkey string) *StatusCmd
- func (c *RingPipeline) RenameNX(key, newkey string) *BoolCmd
- func (c *RingPipeline) Restore(key string, ttl int64, value string) *StatusCmd
- func (c *RingPipeline) SAdd(key string, members ...string) *IntCmd
- func (c *RingPipeline) SCard(key string) *IntCmd
- func (c *RingPipeline) SDiff(keys ...string) *StringSliceCmd
- func (c *RingPipeline) SDiffStore(destination string, keys ...string) *IntCmd
- func (c *RingPipeline) SInter(keys ...string) *StringSliceCmd
- func (c *RingPipeline) SInterStore(destination string, keys ...string) *IntCmd
- func (c *RingPipeline) SIsMember(key, member string) *BoolCmd
- func (c *RingPipeline) SMembers(key string) *StringSliceCmd
- func (c *RingPipeline) SMove(source, destination, member string) *BoolCmd
- func (c *RingPipeline) SPop(key string) *StringCmd
- func (c *RingPipeline) SRandMember(key string) *StringCmd
- func (c *RingPipeline) SRem(key string, members ...string) *IntCmd
- func (c *RingPipeline) SScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *RingPipeline) SUnion(keys ...string) *StringSliceCmd
- func (c *RingPipeline) SUnionStore(destination string, keys ...string) *IntCmd
- func (c *RingPipeline) Save() *StatusCmd
- func (c *RingPipeline) Scan(cursor int64, match string, count int64) *ScanCmd
- func (c *RingPipeline) ScriptExists(scripts ...string) *BoolSliceCmd
- func (c *RingPipeline) ScriptFlush() *StatusCmd
- func (c *RingPipeline) ScriptKill() *StatusCmd
- func (c *RingPipeline) ScriptLoad(script string) *StringCmd
- func (c *RingPipeline) Select(index int64) *StatusCmd
- func (c *RingPipeline) Set(key, value string, expiration time.Duration) *StatusCmd
- func (c *RingPipeline) SetBit(key string, offset int64, value int) *IntCmd
- func (c *RingPipeline) SetNX(key, value string, expiration time.Duration) *BoolCmd
- func (c *RingPipeline) SetRange(key string, offset int64, value string) *IntCmd
- func (c *RingPipeline) Shutdown() *StatusCmd
- func (c *RingPipeline) ShutdownNoSave() *StatusCmd
- func (c *RingPipeline) ShutdownSave() *StatusCmd
- func (c *RingPipeline) SlaveOf(host, port string) *StatusCmd
- func (c *RingPipeline) SlowLog()
- func (c *RingPipeline) Sort(key string, sort Sort) *StringSliceCmd
- func (c *RingPipeline) StrLen(key string) *IntCmd
- func (c *RingPipeline) Sync()
- func (c *RingPipeline) TTL(key string) *DurationCmd
- func (c *RingPipeline) Time() *StringSliceCmd
- func (c *RingPipeline) Type(key string) *StatusCmd
- func (c *RingPipeline) ZAdd(key string, members ...Z) *IntCmd
- func (c *RingPipeline) ZCard(key string) *IntCmd
- func (c *RingPipeline) ZCount(key, min, max string) *IntCmd
- func (c *RingPipeline) ZIncrBy(key string, increment float64, member string) *FloatCmd
- func (c *RingPipeline) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd
- func (c *RingPipeline) ZRange(key string, start, stop int64) *StringSliceCmd
- func (c *RingPipeline) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *RingPipeline) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *RingPipeline) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *RingPipeline) ZRank(key, member string) *IntCmd
- func (c *RingPipeline) ZRem(key string, members ...string) *IntCmd
- func (c *RingPipeline) ZRemRangeByRank(key string, start, stop int64) *IntCmd
- func (c *RingPipeline) ZRemRangeByScore(key, min, max string) *IntCmd
- func (c *RingPipeline) ZRevRange(key string, start, stop int64) *StringSliceCmd
- func (c *RingPipeline) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
- func (c *RingPipeline) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
- func (c *RingPipeline) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd
- func (c *RingPipeline) ZRevRank(key, member string) *IntCmd
- func (c *RingPipeline) ZScan(key string, cursor int64, match string, count int64) *ScanCmd
- func (c *RingPipeline) ZScore(key, member string) *FloatCmd
- func (c *RingPipeline) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd
- type ScanCmd
- type Script
- func (s *Script) Eval(c scripter, keys []string, args []string) *Cmd
- func (s *Script) EvalSha(c scripter, keys []string, args []string) *Cmd
- func (s *Script) Exists(c scripter) *BoolSliceCmd
- func (s *Script) Load(c scripter) *StringCmd
- func (s *Script) Run(c scripter, keys []string, args []string) *Cmd
- type SliceCmd
- type Sort
- type StatusCmd
- type StringCmd
- type StringIntMapCmd
- type StringSliceCmd
- type StringStringMapCmd
- type Subscription
- type Z
- type ZRangeByScore
- type ZSliceCmd
- type ZStore
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var Nil = errorf("redis: nil")
Redis nil reply, .e.g. when key does not exist.
var TxFailedErr = errorf("redis: transaction failed")
Redis transaction failed.
Functions ¶
This section is empty.
Types ¶
type BoolSliceCmd ¶
type BoolSliceCmd struct {
// contains filtered or unexported fields
}
func NewBoolSliceCmd ¶
func NewBoolSliceCmd(args ...string) *BoolSliceCmd
func (*BoolSliceCmd) Result ¶
func (cmd *BoolSliceCmd) Result() ([]bool, error)
func (*BoolSliceCmd) String ¶
func (cmd *BoolSliceCmd) String() string
func (*BoolSliceCmd) Val ¶
func (cmd *BoolSliceCmd) Val() []bool
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Example ¶
err := client.Set("key", "value", 0).Err() if err != nil { panic(err) } val, err := client.Get("key").Result() if err != nil { panic(err) } fmt.Println("key", val) val2, err := client.Get("key2").Result() if err == redis.Nil { fmt.Println("key2 does not exists") } else if err != nil { panic(err) } else { fmt.Println("key2", val2) }
Output: key value key2 does not exists
func NewClient ¶
Example ¶
client := redis.NewClient(&redis.Options{ Addr: "localhost:6379", Password: "", // no password set DB: 0, // use default DB }) pong, err := client.Ping().Result() fmt.Println(pong, err)
Output: PONG <nil>
func NewFailoverClient ¶
func NewFailoverClient(failoverOpt *FailoverOptions) *Client
NewFailoverClient returns a Redis client with automatic failover capabilities using Redis Sentinel.
Example ¶
// See http://redis.io/topics/sentinel for instructions how to // setup Redis Sentinel. client := redis.NewFailoverClient(&redis.FailoverOptions{ MasterName: "master", SentinelAddrs: []string{":26379"}, }) client.Ping()
Output:
func (*Client) BLPop ¶
func (c *Client) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
func (*Client) BRPop ¶
func (c *Client) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
func (*Client) BRPopLPush ¶
func (*Client) BgRewriteAOF ¶
func (c *Client) BgRewriteAOF() *StatusCmd
func (*Client) ClientKill ¶
func (*Client) ClientList ¶
func (c *Client) ClientList() *StringCmd
func (*Client) ClientPause ¶
func (Client) Close ¶
func (c Client) Close() error
Close closes the client, releasing any open resources.
func (*Client) ClusterAddSlots ¶
func (*Client) ClusterAddSlotsRange ¶
func (*Client) ClusterFailover ¶
func (c *Client) ClusterFailover() *StatusCmd
func (*Client) ClusterInfo ¶
func (c *Client) ClusterInfo() *StringCmd
func (*Client) ClusterMeet ¶
func (*Client) ClusterNodes ¶
func (c *Client) ClusterNodes() *StringCmd
func (*Client) ClusterReplicate ¶
func (*Client) ClusterSlots ¶
func (c *Client) ClusterSlots() *ClusterSlotCmd
func (*Client) ConfigResetStat ¶
func (c *Client) ConfigResetStat() *StatusCmd
func (*Client) DebugObject ¶
func (*Client) HGetAll ¶
func (c *Client) HGetAll(key string) *StringSliceCmd
func (*Client) HGetAllMap ¶
func (c *Client) HGetAllMap(key string) *StringStringMapCmd
func (*Client) HIncrByFloat ¶
func (*Client) HKeys ¶
func (c *Client) HKeys(key string) *StringSliceCmd
func (*Client) HVals ¶
func (c *Client) HVals(key string) *StringSliceCmd
func (*Client) Incr ¶
Example ¶
if err := client.Incr("counter").Err(); err != nil { panic(err) } n, err := client.Get("counter").Int64() fmt.Println(n, err)
Output: 1 <nil>
func (*Client) IncrByFloat ¶
func (*Client) Keys ¶
func (c *Client) Keys(pattern string) *StringSliceCmd
func (*Client) LRange ¶
func (c *Client) LRange(key string, start, stop int64) *StringSliceCmd
func (*Client) ObjectEncoding ¶
func (*Client) ObjectIdleTime ¶
func (c *Client) ObjectIdleTime(keys ...string) *DurationCmd
func (*Client) ObjectRefCount ¶
func (*Client) PTTL ¶
func (c *Client) PTTL(key string) *DurationCmd
func (*Client) Pipelined ¶
Example ¶
var incr *redis.IntCmd _, err := client.Pipelined(func(pipe *redis.Pipeline) error { incr = pipe.Incr("counter1") pipe.Expire("counter1", time.Hour) return nil }) fmt.Println(incr.Val(), err)
Output: 1 <nil>
func (*Client) PubSubChannels ¶
func (c *Client) PubSubChannels(pattern string) *StringSliceCmd
func (*Client) PubSubNumPat ¶
func (c *Client) PubSubNumPat() *IntCmd
func (*Client) PubSubNumSub ¶
func (c *Client) PubSubNumSub(channels ...string) *StringIntMapCmd
func (*Client) SDiff ¶
func (c *Client) SDiff(keys ...string) *StringSliceCmd
func (*Client) SDiffStore ¶
func (*Client) SInter ¶
func (c *Client) SInter(keys ...string) *StringSliceCmd
func (*Client) SInterStore ¶
func (*Client) SMembers ¶
func (c *Client) SMembers(key string) *StringSliceCmd
func (*Client) SRandMember ¶
func (*Client) SUnion ¶
func (c *Client) SUnion(keys ...string) *StringSliceCmd
func (*Client) SUnionStore ¶
func (*Client) ScriptExists ¶
func (c *Client) ScriptExists(scripts ...string) *BoolSliceCmd
func (*Client) ScriptFlush ¶
func (c *Client) ScriptFlush() *StatusCmd
func (*Client) ScriptKill ¶
func (c *Client) ScriptKill() *StatusCmd
func (*Client) ScriptLoad ¶
func (*Client) ShutdownNoSave ¶
func (c *Client) ShutdownNoSave() *StatusCmd
func (*Client) ShutdownSave ¶
func (c *Client) ShutdownSave() *StatusCmd
func (*Client) Sort ¶
func (c *Client) Sort(key string, sort Sort) *StringSliceCmd
func (*Client) TTL ¶
func (c *Client) TTL(key string) *DurationCmd
func (*Client) Time ¶
func (c *Client) Time() *StringSliceCmd
func (*Client) ZInterStore ¶
func (*Client) ZRange ¶
func (c *Client) ZRange(key string, start, stop int64) *StringSliceCmd
func (*Client) ZRangeByScore ¶
func (c *Client) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*Client) ZRangeByScoreWithScores ¶
func (c *Client) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*Client) ZRangeWithScores ¶
func (*Client) ZRemRangeByRank ¶
func (*Client) ZRemRangeByScore ¶
func (*Client) ZRevRange ¶
func (c *Client) ZRevRange(key string, start, stop int64) *StringSliceCmd
func (*Client) ZRevRangeByScore ¶
func (c *Client) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*Client) ZRevRangeByScoreWithScores ¶
func (c *Client) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*Client) ZRevRangeWithScores ¶
type ClusterClient ¶
type ClusterClient struct {
// contains filtered or unexported fields
}
func NewClusterClient ¶
func NewClusterClient(opt *ClusterOptions) *ClusterClient
NewClusterClient returns a new Redis Cluster client as described in http://redis.io/topics/cluster-spec.
Example ¶
// See http://redis.io/topics/cluster-tutorial for instructions // how to setup Redis Cluster. client := redis.NewClusterClient(&redis.ClusterOptions{ Addrs: []string{":7000", ":7001", ":7002", ":7003", ":7004", ":7005"}, }) client.Ping()
Output:
func (*ClusterClient) BLPop ¶
func (c *ClusterClient) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
func (*ClusterClient) BRPop ¶
func (c *ClusterClient) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
func (*ClusterClient) BRPopLPush ¶
func (*ClusterClient) BgRewriteAOF ¶
func (c *ClusterClient) BgRewriteAOF() *StatusCmd
func (*ClusterClient) ClientKill ¶
func (*ClusterClient) ClientList ¶
func (c *ClusterClient) ClientList() *StringCmd
func (*ClusterClient) ClientPause ¶
func (*ClusterClient) Close ¶
func (c *ClusterClient) Close() error
Close closes the cluster client, releasing any open resources.
It is rare to Close a Client, as the Client is meant to be long-lived and shared between many goroutines.
func (*ClusterClient) ClusterAddSlots ¶
func (*ClusterClient) ClusterAddSlotsRange ¶
func (*ClusterClient) ClusterFailover ¶
func (c *ClusterClient) ClusterFailover() *StatusCmd
func (*ClusterClient) ClusterInfo ¶
func (c *ClusterClient) ClusterInfo() *StringCmd
func (*ClusterClient) ClusterMeet ¶
func (*ClusterClient) ClusterNodes ¶
func (c *ClusterClient) ClusterNodes() *StringCmd
func (*ClusterClient) ClusterReplicate ¶
func (*ClusterClient) ClusterSlots ¶
func (c *ClusterClient) ClusterSlots() *ClusterSlotCmd
func (*ClusterClient) ConfigResetStat ¶
func (c *ClusterClient) ConfigResetStat() *StatusCmd
func (*ClusterClient) DebugObject ¶
func (*ClusterClient) HGetAll ¶
func (c *ClusterClient) HGetAll(key string) *StringSliceCmd
func (*ClusterClient) HGetAllMap ¶
func (c *ClusterClient) HGetAllMap(key string) *StringStringMapCmd
func (*ClusterClient) HIncrByFloat ¶
func (*ClusterClient) HKeys ¶
func (c *ClusterClient) HKeys(key string) *StringSliceCmd
func (*ClusterClient) HVals ¶
func (c *ClusterClient) HVals(key string) *StringSliceCmd
func (*ClusterClient) IncrByFloat ¶
func (*ClusterClient) Keys ¶
func (c *ClusterClient) Keys(pattern string) *StringSliceCmd
func (*ClusterClient) LRange ¶
func (c *ClusterClient) LRange(key string, start, stop int64) *StringSliceCmd
func (*ClusterClient) ObjectEncoding ¶
func (*ClusterClient) ObjectIdleTime ¶
func (c *ClusterClient) ObjectIdleTime(keys ...string) *DurationCmd
func (*ClusterClient) ObjectRefCount ¶
func (*ClusterClient) PTTL ¶
func (c *ClusterClient) PTTL(key string) *DurationCmd
func (*ClusterClient) Pipeline ¶
func (c *ClusterClient) Pipeline() *ClusterPipeline
Pipeline creates a new pipeline which is able to execute commands against multiple shards.
func (*ClusterClient) PubSubChannels ¶
func (c *ClusterClient) PubSubChannels(pattern string) *StringSliceCmd
func (*ClusterClient) PubSubNumPat ¶
func (c *ClusterClient) PubSubNumPat() *IntCmd
func (*ClusterClient) PubSubNumSub ¶
func (c *ClusterClient) PubSubNumSub(channels ...string) *StringIntMapCmd
func (*ClusterClient) SDiff ¶
func (c *ClusterClient) SDiff(keys ...string) *StringSliceCmd
func (*ClusterClient) SDiffStore ¶
func (*ClusterClient) SInter ¶
func (c *ClusterClient) SInter(keys ...string) *StringSliceCmd
func (*ClusterClient) SInterStore ¶
func (*ClusterClient) SMembers ¶
func (c *ClusterClient) SMembers(key string) *StringSliceCmd
func (*ClusterClient) SRandMember ¶
func (*ClusterClient) SUnion ¶
func (c *ClusterClient) SUnion(keys ...string) *StringSliceCmd
func (*ClusterClient) SUnionStore ¶
func (*ClusterClient) ScriptExists ¶
func (c *ClusterClient) ScriptExists(scripts ...string) *BoolSliceCmd
func (*ClusterClient) ScriptFlush ¶
func (c *ClusterClient) ScriptFlush() *StatusCmd
func (*ClusterClient) ScriptKill ¶
func (c *ClusterClient) ScriptKill() *StatusCmd
func (*ClusterClient) ScriptLoad ¶
func (*ClusterClient) ShutdownNoSave ¶
func (c *ClusterClient) ShutdownNoSave() *StatusCmd
func (*ClusterClient) ShutdownSave ¶
func (c *ClusterClient) ShutdownSave() *StatusCmd
func (*ClusterClient) Sort ¶
func (c *ClusterClient) Sort(key string, sort Sort) *StringSliceCmd
func (*ClusterClient) TTL ¶
func (c *ClusterClient) TTL(key string) *DurationCmd
func (*ClusterClient) Time ¶
func (c *ClusterClient) Time() *StringSliceCmd
func (*ClusterClient) ZInterStore ¶
func (*ClusterClient) ZRange ¶
func (c *ClusterClient) ZRange(key string, start, stop int64) *StringSliceCmd
func (*ClusterClient) ZRangeByScore ¶
func (c *ClusterClient) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*ClusterClient) ZRangeByScoreWithScores ¶
func (c *ClusterClient) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*ClusterClient) ZRangeWithScores ¶
func (*ClusterClient) ZRemRangeByRank ¶
func (*ClusterClient) ZRemRangeByScore ¶
func (*ClusterClient) ZRevRange ¶
func (c *ClusterClient) ZRevRange(key string, start, stop int64) *StringSliceCmd
func (*ClusterClient) ZRevRangeByScore ¶
func (c *ClusterClient) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*ClusterClient) ZRevRangeByScoreWithScores ¶
func (c *ClusterClient) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*ClusterClient) ZRevRangeWithScores ¶
type ClusterOptions ¶
type ClusterOptions struct { // A seed list of host:port addresses of cluster nodes. Addrs []string // The maximum number of MOVED/ASK redirects to follow before // giving up. // Default is 16 MaxRedirects int Password string DialTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration PoolSize int PoolTimeout time.Duration IdleTimeout time.Duration }
ClusterOptions are used to configure a cluster client and should be passed to NewClusterClient.
type ClusterPipeline ¶
type ClusterPipeline struct {
// contains filtered or unexported fields
}
ClusterPipeline is not thread-safe.
func (*ClusterPipeline) BLPop ¶
func (c *ClusterPipeline) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
func (*ClusterPipeline) BRPop ¶
func (c *ClusterPipeline) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
func (*ClusterPipeline) BRPopLPush ¶
func (*ClusterPipeline) BgRewriteAOF ¶
func (c *ClusterPipeline) BgRewriteAOF() *StatusCmd
func (*ClusterPipeline) ClientKill ¶
func (*ClusterPipeline) ClientList ¶
func (c *ClusterPipeline) ClientList() *StringCmd
func (*ClusterPipeline) ClientPause ¶
func (*ClusterPipeline) Close ¶
func (pipe *ClusterPipeline) Close() error
Close marks the pipeline as closed
func (*ClusterPipeline) ClusterAddSlots ¶
func (*ClusterPipeline) ClusterAddSlotsRange ¶
func (*ClusterPipeline) ClusterFailover ¶
func (c *ClusterPipeline) ClusterFailover() *StatusCmd
func (*ClusterPipeline) ClusterInfo ¶
func (c *ClusterPipeline) ClusterInfo() *StringCmd
func (*ClusterPipeline) ClusterMeet ¶
func (*ClusterPipeline) ClusterNodes ¶
func (c *ClusterPipeline) ClusterNodes() *StringCmd
func (*ClusterPipeline) ClusterReplicate ¶
func (*ClusterPipeline) ClusterSlots ¶
func (c *ClusterPipeline) ClusterSlots() *ClusterSlotCmd
func (*ClusterPipeline) ConfigResetStat ¶
func (c *ClusterPipeline) ConfigResetStat() *StatusCmd
func (*ClusterPipeline) DebugObject ¶
func (*ClusterPipeline) Discard ¶
func (pipe *ClusterPipeline) Discard() error
Discard resets the pipeline and discards queued commands.
func (*ClusterPipeline) Exec ¶
func (pipe *ClusterPipeline) Exec() (cmds []Cmder, retErr error)
func (*ClusterPipeline) HGetAll ¶
func (c *ClusterPipeline) HGetAll(key string) *StringSliceCmd
func (*ClusterPipeline) HGetAllMap ¶
func (c *ClusterPipeline) HGetAllMap(key string) *StringStringMapCmd
func (*ClusterPipeline) HIncrByFloat ¶
func (*ClusterPipeline) HKeys ¶
func (c *ClusterPipeline) HKeys(key string) *StringSliceCmd
func (*ClusterPipeline) HVals ¶
func (c *ClusterPipeline) HVals(key string) *StringSliceCmd
func (*ClusterPipeline) IncrByFloat ¶
func (*ClusterPipeline) Keys ¶
func (c *ClusterPipeline) Keys(pattern string) *StringSliceCmd
func (*ClusterPipeline) LRange ¶
func (c *ClusterPipeline) LRange(key string, start, stop int64) *StringSliceCmd
func (*ClusterPipeline) ObjectEncoding ¶
func (*ClusterPipeline) ObjectIdleTime ¶
func (c *ClusterPipeline) ObjectIdleTime(keys ...string) *DurationCmd
func (*ClusterPipeline) ObjectRefCount ¶
func (*ClusterPipeline) PTTL ¶
func (c *ClusterPipeline) PTTL(key string) *DurationCmd
func (*ClusterPipeline) PubSubChannels ¶
func (c *ClusterPipeline) PubSubChannels(pattern string) *StringSliceCmd
func (*ClusterPipeline) PubSubNumPat ¶
func (c *ClusterPipeline) PubSubNumPat() *IntCmd
func (*ClusterPipeline) PubSubNumSub ¶
func (c *ClusterPipeline) PubSubNumSub(channels ...string) *StringIntMapCmd
func (*ClusterPipeline) SDiff ¶
func (c *ClusterPipeline) SDiff(keys ...string) *StringSliceCmd
func (*ClusterPipeline) SDiffStore ¶
func (*ClusterPipeline) SInter ¶
func (c *ClusterPipeline) SInter(keys ...string) *StringSliceCmd
func (*ClusterPipeline) SInterStore ¶
func (*ClusterPipeline) SMembers ¶
func (c *ClusterPipeline) SMembers(key string) *StringSliceCmd
func (*ClusterPipeline) SRandMember ¶
func (*ClusterPipeline) SUnion ¶
func (c *ClusterPipeline) SUnion(keys ...string) *StringSliceCmd
func (*ClusterPipeline) SUnionStore ¶
func (*ClusterPipeline) ScriptExists ¶
func (c *ClusterPipeline) ScriptExists(scripts ...string) *BoolSliceCmd
func (*ClusterPipeline) ScriptFlush ¶
func (c *ClusterPipeline) ScriptFlush() *StatusCmd
func (*ClusterPipeline) ScriptKill ¶
func (c *ClusterPipeline) ScriptKill() *StatusCmd
func (*ClusterPipeline) ScriptLoad ¶
func (*ClusterPipeline) ShutdownNoSave ¶
func (c *ClusterPipeline) ShutdownNoSave() *StatusCmd
func (*ClusterPipeline) ShutdownSave ¶
func (c *ClusterPipeline) ShutdownSave() *StatusCmd
func (*ClusterPipeline) Sort ¶
func (c *ClusterPipeline) Sort(key string, sort Sort) *StringSliceCmd
func (*ClusterPipeline) TTL ¶
func (c *ClusterPipeline) TTL(key string) *DurationCmd
func (*ClusterPipeline) Time ¶
func (c *ClusterPipeline) Time() *StringSliceCmd
func (*ClusterPipeline) ZInterStore ¶
func (*ClusterPipeline) ZRange ¶
func (c *ClusterPipeline) ZRange(key string, start, stop int64) *StringSliceCmd
func (*ClusterPipeline) ZRangeByScore ¶
func (c *ClusterPipeline) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*ClusterPipeline) ZRangeByScoreWithScores ¶
func (c *ClusterPipeline) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*ClusterPipeline) ZRangeWithScores ¶
func (*ClusterPipeline) ZRemRangeByRank ¶
func (*ClusterPipeline) ZRemRangeByScore ¶
func (*ClusterPipeline) ZRevRange ¶
func (c *ClusterPipeline) ZRevRange(key string, start, stop int64) *StringSliceCmd
func (*ClusterPipeline) ZRevRangeByScore ¶
func (c *ClusterPipeline) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*ClusterPipeline) ZRevRangeByScoreWithScores ¶
func (c *ClusterPipeline) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*ClusterPipeline) ZRevRangeWithScores ¶
type ClusterSlotCmd ¶
type ClusterSlotCmd struct {
// contains filtered or unexported fields
}
func NewClusterSlotCmd ¶
func NewClusterSlotCmd(args ...string) *ClusterSlotCmd
func (*ClusterSlotCmd) Result ¶
func (cmd *ClusterSlotCmd) Result() ([]ClusterSlotInfo, error)
func (*ClusterSlotCmd) String ¶
func (cmd *ClusterSlotCmd) String() string
func (*ClusterSlotCmd) Val ¶
func (cmd *ClusterSlotCmd) Val() []ClusterSlotInfo
type ClusterSlotInfo ¶
type DurationCmd ¶
type DurationCmd struct {
// contains filtered or unexported fields
}
func NewDurationCmd ¶
func NewDurationCmd(precision time.Duration, args ...string) *DurationCmd
func (*DurationCmd) String ¶
func (cmd *DurationCmd) String() string
func (*DurationCmd) Val ¶
func (cmd *DurationCmd) Val() time.Duration
type FailoverOptions ¶
type FailoverOptions struct { // The master name. MasterName string // A seed list of host:port addresses of sentinel nodes. SentinelAddrs []string Password string DB int64 DialTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration PoolSize int PoolTimeout time.Duration IdleTimeout time.Duration }
FailoverOptions are used to configure a failover client and should be passed to NewFailoverClient.
type FloatCmd ¶
type FloatCmd struct {
// contains filtered or unexported fields
}
func NewFloatCmd ¶
type Multi ¶
type Multi struct {
// contains filtered or unexported fields
}
Multi implements Redis transactions as described in http://redis.io/topics/transactions.
Example ¶
// Transactionally increments key using GET and SET commands. incr := func(tx *redis.Multi, key string) error { err := tx.Watch(key).Err() if err != nil { return err } n, err := tx.Get(key).Int64() if err != nil && err != redis.Nil { return err } _, err = tx.Exec(func() error { tx.Set(key, strconv.FormatInt(n+1, 10), 0) return nil }) return err } var wg sync.WaitGroup for i := 0; i < 10; i++ { wg.Add(1) go func() { defer wg.Done() tx := client.Multi() defer tx.Close() for { err := incr(tx, "counter3") if err == redis.TxFailedErr { // Retry. continue } else if err != nil { panic(err) } break } }() } wg.Wait() n, err := client.Get("counter3").Int64() fmt.Println(n, err)
Output: 10 <nil>
func (*Multi) BRPopLPush ¶
func (*Multi) BgRewriteAOF ¶
func (c *Multi) BgRewriteAOF() *StatusCmd
func (*Multi) ClientKill ¶
func (*Multi) ClientList ¶
func (c *Multi) ClientList() *StringCmd
func (*Multi) ClientPause ¶
func (*Multi) ClusterAddSlots ¶
func (*Multi) ClusterAddSlotsRange ¶
func (*Multi) ClusterFailover ¶
func (c *Multi) ClusterFailover() *StatusCmd
func (*Multi) ClusterInfo ¶
func (c *Multi) ClusterInfo() *StringCmd
func (*Multi) ClusterMeet ¶
func (*Multi) ClusterNodes ¶
func (c *Multi) ClusterNodes() *StringCmd
func (*Multi) ClusterReplicate ¶
func (*Multi) ClusterSlots ¶
func (c *Multi) ClusterSlots() *ClusterSlotCmd
func (*Multi) ConfigResetStat ¶
func (c *Multi) ConfigResetStat() *StatusCmd
func (*Multi) DebugObject ¶
func (*Multi) Exec ¶
Exec always returns list of commands. If transaction fails TxFailedErr is returned. Otherwise Exec returns error of the first failed command or nil.
func (*Multi) HGetAll ¶
func (c *Multi) HGetAll(key string) *StringSliceCmd
func (*Multi) HGetAllMap ¶
func (c *Multi) HGetAllMap(key string) *StringStringMapCmd
func (*Multi) HIncrByFloat ¶
func (*Multi) HKeys ¶
func (c *Multi) HKeys(key string) *StringSliceCmd
func (*Multi) HVals ¶
func (c *Multi) HVals(key string) *StringSliceCmd
func (*Multi) IncrByFloat ¶
func (*Multi) Keys ¶
func (c *Multi) Keys(pattern string) *StringSliceCmd
func (*Multi) LRange ¶
func (c *Multi) LRange(key string, start, stop int64) *StringSliceCmd
func (*Multi) ObjectEncoding ¶
func (*Multi) ObjectIdleTime ¶
func (c *Multi) ObjectIdleTime(keys ...string) *DurationCmd
func (*Multi) ObjectRefCount ¶
func (*Multi) PTTL ¶
func (c *Multi) PTTL(key string) *DurationCmd
func (*Multi) PubSubChannels ¶
func (c *Multi) PubSubChannels(pattern string) *StringSliceCmd
func (*Multi) PubSubNumPat ¶
func (c *Multi) PubSubNumPat() *IntCmd
func (*Multi) PubSubNumSub ¶
func (c *Multi) PubSubNumSub(channels ...string) *StringIntMapCmd
func (*Multi) SDiff ¶
func (c *Multi) SDiff(keys ...string) *StringSliceCmd
func (*Multi) SDiffStore ¶
func (*Multi) SInter ¶
func (c *Multi) SInter(keys ...string) *StringSliceCmd
func (*Multi) SInterStore ¶
func (*Multi) SMembers ¶
func (c *Multi) SMembers(key string) *StringSliceCmd
func (*Multi) SRandMember ¶
func (*Multi) SUnion ¶
func (c *Multi) SUnion(keys ...string) *StringSliceCmd
func (*Multi) SUnionStore ¶
func (*Multi) ScriptExists ¶
func (c *Multi) ScriptExists(scripts ...string) *BoolSliceCmd
func (*Multi) ScriptFlush ¶
func (c *Multi) ScriptFlush() *StatusCmd
func (*Multi) ScriptKill ¶
func (c *Multi) ScriptKill() *StatusCmd
func (*Multi) ScriptLoad ¶
func (*Multi) ShutdownNoSave ¶
func (c *Multi) ShutdownNoSave() *StatusCmd
func (*Multi) ShutdownSave ¶
func (c *Multi) ShutdownSave() *StatusCmd
func (*Multi) Sort ¶
func (c *Multi) Sort(key string, sort Sort) *StringSliceCmd
func (*Multi) TTL ¶
func (c *Multi) TTL(key string) *DurationCmd
func (*Multi) Time ¶
func (c *Multi) Time() *StringSliceCmd
func (*Multi) ZInterStore ¶
func (*Multi) ZRange ¶
func (c *Multi) ZRange(key string, start, stop int64) *StringSliceCmd
func (*Multi) ZRangeByScore ¶
func (c *Multi) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*Multi) ZRangeByScoreWithScores ¶
func (c *Multi) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*Multi) ZRangeWithScores ¶
func (*Multi) ZRemRangeByRank ¶
func (*Multi) ZRemRangeByScore ¶
func (*Multi) ZRevRange ¶
func (c *Multi) ZRevRange(key string, start, stop int64) *StringSliceCmd
func (*Multi) ZRevRangeByScore ¶
func (c *Multi) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*Multi) ZRevRangeByScoreWithScores ¶
func (c *Multi) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*Multi) ZRevRangeWithScores ¶
type Options ¶
type Options struct { // The network type, either tcp or unix. // Default is tcp. Network string // host:port address. Addr string // Dialer creates new network connection and has priority over // Network and Addr options. Dialer func() (net.Conn, error) // An optional password. Must match the password specified in the // requirepass server configuration option. Password string // A database to be selected after connecting to server. DB int64 // The maximum number of retries before giving up. // Default is to not retry failed commands. MaxRetries int // Sets the deadline for establishing new connections. If reached, // dial will fail with a timeout. DialTimeout time.Duration // Sets the deadline for socket reads. If reached, commands will // fail with a timeout instead of blocking. ReadTimeout time.Duration // Sets the deadline for socket writes. If reached, commands will // fail with a timeout instead of blocking. WriteTimeout time.Duration // The maximum number of socket connections. // Default is 10 connections. PoolSize int // Specifies amount of time client waits for connection if all // connections are busy before returning an error. // Default is 5 seconds. PoolTimeout time.Duration // Specifies amount of time after which client closes idle // connections. Should be less than server's timeout. // Default is to not close idle connections. IdleTimeout time.Duration }
type PMessage ¶
Message matching a pattern-matching subscription received as result of a PUBLISH command issued by another client.
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline implements pipelining as described in http://redis.io/topics/pipelining.
Pipeline is not thread-safe.
Example ¶
pipe := client.Pipeline() defer pipe.Close() incr := pipe.Incr("counter2") pipe.Expire("counter2", time.Hour) _, err := pipe.Exec() fmt.Println(incr.Val(), err)
Output: 1 <nil>
func (*Pipeline) BLPop ¶
func (c *Pipeline) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
func (*Pipeline) BRPop ¶
func (c *Pipeline) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
func (*Pipeline) BRPopLPush ¶
func (*Pipeline) BgRewriteAOF ¶
func (c *Pipeline) BgRewriteAOF() *StatusCmd
func (*Pipeline) ClientKill ¶
func (*Pipeline) ClientList ¶
func (c *Pipeline) ClientList() *StringCmd
func (*Pipeline) ClientPause ¶
func (*Pipeline) ClusterAddSlots ¶
func (*Pipeline) ClusterAddSlotsRange ¶
func (*Pipeline) ClusterFailover ¶
func (c *Pipeline) ClusterFailover() *StatusCmd
func (*Pipeline) ClusterInfo ¶
func (c *Pipeline) ClusterInfo() *StringCmd
func (*Pipeline) ClusterMeet ¶
func (*Pipeline) ClusterNodes ¶
func (c *Pipeline) ClusterNodes() *StringCmd
func (*Pipeline) ClusterReplicate ¶
func (*Pipeline) ClusterSlots ¶
func (c *Pipeline) ClusterSlots() *ClusterSlotCmd
func (*Pipeline) ConfigResetStat ¶
func (c *Pipeline) ConfigResetStat() *StatusCmd
func (*Pipeline) DebugObject ¶
func (*Pipeline) Exec ¶
Exec always returns list of commands and error of the first failed command if any.
func (*Pipeline) HGetAll ¶
func (c *Pipeline) HGetAll(key string) *StringSliceCmd
func (*Pipeline) HGetAllMap ¶
func (c *Pipeline) HGetAllMap(key string) *StringStringMapCmd
func (*Pipeline) HIncrByFloat ¶
func (*Pipeline) HKeys ¶
func (c *Pipeline) HKeys(key string) *StringSliceCmd
func (*Pipeline) HVals ¶
func (c *Pipeline) HVals(key string) *StringSliceCmd
func (*Pipeline) IncrByFloat ¶
func (*Pipeline) Keys ¶
func (c *Pipeline) Keys(pattern string) *StringSliceCmd
func (*Pipeline) LRange ¶
func (c *Pipeline) LRange(key string, start, stop int64) *StringSliceCmd
func (*Pipeline) ObjectEncoding ¶
func (*Pipeline) ObjectIdleTime ¶
func (c *Pipeline) ObjectIdleTime(keys ...string) *DurationCmd
func (*Pipeline) ObjectRefCount ¶
func (*Pipeline) PTTL ¶
func (c *Pipeline) PTTL(key string) *DurationCmd
func (*Pipeline) PubSubChannels ¶
func (c *Pipeline) PubSubChannels(pattern string) *StringSliceCmd
func (*Pipeline) PubSubNumPat ¶
func (c *Pipeline) PubSubNumPat() *IntCmd
func (*Pipeline) PubSubNumSub ¶
func (c *Pipeline) PubSubNumSub(channels ...string) *StringIntMapCmd
func (*Pipeline) SDiff ¶
func (c *Pipeline) SDiff(keys ...string) *StringSliceCmd
func (*Pipeline) SDiffStore ¶
func (*Pipeline) SInter ¶
func (c *Pipeline) SInter(keys ...string) *StringSliceCmd
func (*Pipeline) SInterStore ¶
func (*Pipeline) SMembers ¶
func (c *Pipeline) SMembers(key string) *StringSliceCmd
func (*Pipeline) SRandMember ¶
func (*Pipeline) SUnion ¶
func (c *Pipeline) SUnion(keys ...string) *StringSliceCmd
func (*Pipeline) SUnionStore ¶
func (*Pipeline) ScriptExists ¶
func (c *Pipeline) ScriptExists(scripts ...string) *BoolSliceCmd
func (*Pipeline) ScriptFlush ¶
func (c *Pipeline) ScriptFlush() *StatusCmd
func (*Pipeline) ScriptKill ¶
func (c *Pipeline) ScriptKill() *StatusCmd
func (*Pipeline) ScriptLoad ¶
func (*Pipeline) ShutdownNoSave ¶
func (c *Pipeline) ShutdownNoSave() *StatusCmd
func (*Pipeline) ShutdownSave ¶
func (c *Pipeline) ShutdownSave() *StatusCmd
func (*Pipeline) Sort ¶
func (c *Pipeline) Sort(key string, sort Sort) *StringSliceCmd
func (*Pipeline) TTL ¶
func (c *Pipeline) TTL(key string) *DurationCmd
func (*Pipeline) Time ¶
func (c *Pipeline) Time() *StringSliceCmd
func (*Pipeline) ZInterStore ¶
func (*Pipeline) ZRange ¶
func (c *Pipeline) ZRange(key string, start, stop int64) *StringSliceCmd
func (*Pipeline) ZRangeByScore ¶
func (c *Pipeline) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*Pipeline) ZRangeByScoreWithScores ¶
func (c *Pipeline) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*Pipeline) ZRangeWithScores ¶
func (*Pipeline) ZRemRangeByRank ¶
func (*Pipeline) ZRemRangeByScore ¶
func (*Pipeline) ZRevRange ¶
func (c *Pipeline) ZRevRange(key string, start, stop int64) *StringSliceCmd
func (*Pipeline) ZRevRangeByScore ¶
func (c *Pipeline) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*Pipeline) ZRevRangeByScoreWithScores ¶
func (c *Pipeline) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*Pipeline) ZRevRangeWithScores ¶
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
PubSub implements Pub/Sub commands as described in http://redis.io/topics/pubsub.
Example ¶
pubsub := client.PubSub() defer pubsub.Close() err := pubsub.Subscribe("mychannel") if err != nil { panic(err) } err = client.Publish("mychannel", "hello").Err() if err != nil { panic(err) } for { msgi, err := pubsub.ReceiveTimeout(100 * time.Millisecond) if err != nil { if neterr, ok := err.(net.Error); ok && neterr.Timeout() { // There are no more messages to process. Stop. break } panic(err) } switch msg := msgi.(type) { case *redis.Subscription: fmt.Println(msg.Kind, msg.Channel) case *redis.Message: fmt.Println(msg.Channel, msg.Payload) default: panic(fmt.Sprintf("unknown message: %#v", msgi)) } }
Output: subscribe mychannel mychannel hello
func (PubSub) Close ¶
func (c PubSub) Close() error
Close closes the client, releasing any open resources.
func (*PubSub) PSubscribe ¶
func (*PubSub) PUnsubscribe ¶
func (*PubSub) ReceiveTimeout ¶
func (*PubSub) Unsubscribe ¶
type Ring ¶
type Ring struct {
// contains filtered or unexported fields
}
Ring is a Redis client that uses constistent hashing to distribute keys across multiple Redis servers (shards).
It monitors the state of each shard and removes dead shards from the ring. When shard comes online it is added back to the ring. This gives you maximum availability and partition tolerance, but no consistency between different shards or even clients. Each client uses shards that are available to the client and does not do any coordination when shard state is changed.
Ring should be used when you use multiple Redis servers for caching and can tolerate losing data when one of the servers dies. Otherwise you should use Redis Cluster.
func NewRing ¶
func NewRing(opt *RingOptions) *Ring
Example ¶
client := redis.NewRing(&redis.RingOptions{ Addrs: map[string]string{ "shard1": ":7000", "shard2": ":7001", "shard3": ":7002", }, }) client.Ping()
Output:
func (*Ring) BRPopLPush ¶
func (*Ring) BgRewriteAOF ¶
func (c *Ring) BgRewriteAOF() *StatusCmd
func (*Ring) ClientKill ¶
func (*Ring) ClientList ¶
func (c *Ring) ClientList() *StringCmd
func (*Ring) ClientPause ¶
func (*Ring) Close ¶
Close closes the ring client, releasing any open resources.
It is rare to Close a Client, as the Client is meant to be long-lived and shared between many goroutines.
func (*Ring) ClusterAddSlots ¶
func (*Ring) ClusterAddSlotsRange ¶
func (*Ring) ClusterFailover ¶
func (c *Ring) ClusterFailover() *StatusCmd
func (*Ring) ClusterInfo ¶
func (c *Ring) ClusterInfo() *StringCmd
func (*Ring) ClusterMeet ¶
func (*Ring) ClusterNodes ¶
func (c *Ring) ClusterNodes() *StringCmd
func (*Ring) ClusterReplicate ¶
func (*Ring) ClusterSlots ¶
func (c *Ring) ClusterSlots() *ClusterSlotCmd
func (*Ring) ConfigResetStat ¶
func (c *Ring) ConfigResetStat() *StatusCmd
func (*Ring) DebugObject ¶
func (*Ring) HGetAll ¶
func (c *Ring) HGetAll(key string) *StringSliceCmd
func (*Ring) HGetAllMap ¶
func (c *Ring) HGetAllMap(key string) *StringStringMapCmd
func (*Ring) HIncrByFloat ¶
func (*Ring) HKeys ¶
func (c *Ring) HKeys(key string) *StringSliceCmd
func (*Ring) HVals ¶
func (c *Ring) HVals(key string) *StringSliceCmd
func (*Ring) IncrByFloat ¶
func (*Ring) Keys ¶
func (c *Ring) Keys(pattern string) *StringSliceCmd
func (*Ring) LRange ¶
func (c *Ring) LRange(key string, start, stop int64) *StringSliceCmd
func (*Ring) ObjectEncoding ¶
func (*Ring) ObjectIdleTime ¶
func (c *Ring) ObjectIdleTime(keys ...string) *DurationCmd
func (*Ring) ObjectRefCount ¶
func (*Ring) PTTL ¶
func (c *Ring) PTTL(key string) *DurationCmd
func (*Ring) Pipeline ¶
func (ring *Ring) Pipeline() *RingPipeline
func (*Ring) PubSubChannels ¶
func (c *Ring) PubSubChannels(pattern string) *StringSliceCmd
func (*Ring) PubSubNumPat ¶
func (c *Ring) PubSubNumPat() *IntCmd
func (*Ring) PubSubNumSub ¶
func (c *Ring) PubSubNumSub(channels ...string) *StringIntMapCmd
func (*Ring) SDiff ¶
func (c *Ring) SDiff(keys ...string) *StringSliceCmd
func (*Ring) SDiffStore ¶
func (*Ring) SInter ¶
func (c *Ring) SInter(keys ...string) *StringSliceCmd
func (*Ring) SInterStore ¶
func (*Ring) SMembers ¶
func (c *Ring) SMembers(key string) *StringSliceCmd
func (*Ring) SRandMember ¶
func (*Ring) SUnion ¶
func (c *Ring) SUnion(keys ...string) *StringSliceCmd
func (*Ring) SUnionStore ¶
func (*Ring) ScriptExists ¶
func (c *Ring) ScriptExists(scripts ...string) *BoolSliceCmd
func (*Ring) ScriptFlush ¶
func (c *Ring) ScriptFlush() *StatusCmd
func (*Ring) ScriptKill ¶
func (c *Ring) ScriptKill() *StatusCmd
func (*Ring) ScriptLoad ¶
func (*Ring) ShutdownNoSave ¶
func (c *Ring) ShutdownNoSave() *StatusCmd
func (*Ring) ShutdownSave ¶
func (c *Ring) ShutdownSave() *StatusCmd
func (*Ring) Sort ¶
func (c *Ring) Sort(key string, sort Sort) *StringSliceCmd
func (*Ring) TTL ¶
func (c *Ring) TTL(key string) *DurationCmd
func (*Ring) Time ¶
func (c *Ring) Time() *StringSliceCmd
func (*Ring) ZInterStore ¶
func (*Ring) ZRange ¶
func (c *Ring) ZRange(key string, start, stop int64) *StringSliceCmd
func (*Ring) ZRangeByScore ¶
func (c *Ring) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*Ring) ZRangeByScoreWithScores ¶
func (c *Ring) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*Ring) ZRangeWithScores ¶
func (*Ring) ZRemRangeByRank ¶
func (*Ring) ZRemRangeByScore ¶
func (*Ring) ZRevRange ¶
func (c *Ring) ZRevRange(key string, start, stop int64) *StringSliceCmd
func (*Ring) ZRevRangeByScore ¶
func (c *Ring) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*Ring) ZRevRangeByScoreWithScores ¶
func (c *Ring) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*Ring) ZRevRangeWithScores ¶
type RingOptions ¶
type RingOptions struct { // A map of name => host:port addresses of ring shards. Addrs map[string]string DB int64 Password string MaxRetries int DialTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration PoolSize int PoolTimeout time.Duration IdleTimeout time.Duration }
RingOptions are used to configure a ring client and should be passed to NewRing.
type RingPipeline ¶
type RingPipeline struct {
// contains filtered or unexported fields
}
RingPipeline creates a new pipeline which is able to execute commands against multiple shards.
func (*RingPipeline) BLPop ¶
func (c *RingPipeline) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd
func (*RingPipeline) BRPop ¶
func (c *RingPipeline) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd
func (*RingPipeline) BRPopLPush ¶
func (*RingPipeline) BgRewriteAOF ¶
func (c *RingPipeline) BgRewriteAOF() *StatusCmd
func (*RingPipeline) ClientKill ¶
func (*RingPipeline) ClientList ¶
func (c *RingPipeline) ClientList() *StringCmd
func (*RingPipeline) ClientPause ¶
func (*RingPipeline) Close ¶
func (pipe *RingPipeline) Close() error
func (*RingPipeline) ClusterAddSlots ¶
func (*RingPipeline) ClusterAddSlotsRange ¶
func (*RingPipeline) ClusterFailover ¶
func (c *RingPipeline) ClusterFailover() *StatusCmd
func (*RingPipeline) ClusterInfo ¶
func (c *RingPipeline) ClusterInfo() *StringCmd
func (*RingPipeline) ClusterMeet ¶
func (*RingPipeline) ClusterNodes ¶
func (c *RingPipeline) ClusterNodes() *StringCmd
func (*RingPipeline) ClusterReplicate ¶
func (*RingPipeline) ClusterSlots ¶
func (c *RingPipeline) ClusterSlots() *ClusterSlotCmd
func (*RingPipeline) ConfigResetStat ¶
func (c *RingPipeline) ConfigResetStat() *StatusCmd
func (*RingPipeline) DebugObject ¶
func (*RingPipeline) Discard ¶
func (pipe *RingPipeline) Discard() error
Discard resets the pipeline and discards queued commands.
func (*RingPipeline) Exec ¶
func (pipe *RingPipeline) Exec() (cmds []Cmder, retErr error)
Exec always returns list of commands and error of the first failed command if any.
func (*RingPipeline) HGetAll ¶
func (c *RingPipeline) HGetAll(key string) *StringSliceCmd
func (*RingPipeline) HGetAllMap ¶
func (c *RingPipeline) HGetAllMap(key string) *StringStringMapCmd
func (*RingPipeline) HIncrByFloat ¶
func (*RingPipeline) HKeys ¶
func (c *RingPipeline) HKeys(key string) *StringSliceCmd
func (*RingPipeline) HVals ¶
func (c *RingPipeline) HVals(key string) *StringSliceCmd
func (*RingPipeline) IncrByFloat ¶
func (*RingPipeline) Keys ¶
func (c *RingPipeline) Keys(pattern string) *StringSliceCmd
func (*RingPipeline) LRange ¶
func (c *RingPipeline) LRange(key string, start, stop int64) *StringSliceCmd
func (*RingPipeline) ObjectEncoding ¶
func (*RingPipeline) ObjectIdleTime ¶
func (c *RingPipeline) ObjectIdleTime(keys ...string) *DurationCmd
func (*RingPipeline) ObjectRefCount ¶
func (*RingPipeline) PTTL ¶
func (c *RingPipeline) PTTL(key string) *DurationCmd
func (*RingPipeline) PubSubChannels ¶
func (c *RingPipeline) PubSubChannels(pattern string) *StringSliceCmd
func (*RingPipeline) PubSubNumPat ¶
func (c *RingPipeline) PubSubNumPat() *IntCmd
func (*RingPipeline) PubSubNumSub ¶
func (c *RingPipeline) PubSubNumSub(channels ...string) *StringIntMapCmd
func (*RingPipeline) SDiff ¶
func (c *RingPipeline) SDiff(keys ...string) *StringSliceCmd
func (*RingPipeline) SDiffStore ¶
func (*RingPipeline) SInter ¶
func (c *RingPipeline) SInter(keys ...string) *StringSliceCmd
func (*RingPipeline) SInterStore ¶
func (*RingPipeline) SMembers ¶
func (c *RingPipeline) SMembers(key string) *StringSliceCmd
func (*RingPipeline) SRandMember ¶
func (*RingPipeline) SUnion ¶
func (c *RingPipeline) SUnion(keys ...string) *StringSliceCmd
func (*RingPipeline) SUnionStore ¶
func (*RingPipeline) ScriptExists ¶
func (c *RingPipeline) ScriptExists(scripts ...string) *BoolSliceCmd
func (*RingPipeline) ScriptFlush ¶
func (c *RingPipeline) ScriptFlush() *StatusCmd
func (*RingPipeline) ScriptKill ¶
func (c *RingPipeline) ScriptKill() *StatusCmd
func (*RingPipeline) ScriptLoad ¶
func (*RingPipeline) ShutdownNoSave ¶
func (c *RingPipeline) ShutdownNoSave() *StatusCmd
func (*RingPipeline) ShutdownSave ¶
func (c *RingPipeline) ShutdownSave() *StatusCmd
func (*RingPipeline) Sort ¶
func (c *RingPipeline) Sort(key string, sort Sort) *StringSliceCmd
func (*RingPipeline) TTL ¶
func (c *RingPipeline) TTL(key string) *DurationCmd
func (*RingPipeline) Time ¶
func (c *RingPipeline) Time() *StringSliceCmd
func (*RingPipeline) ZInterStore ¶
func (*RingPipeline) ZRange ¶
func (c *RingPipeline) ZRange(key string, start, stop int64) *StringSliceCmd
func (*RingPipeline) ZRangeByScore ¶
func (c *RingPipeline) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*RingPipeline) ZRangeByScoreWithScores ¶
func (c *RingPipeline) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*RingPipeline) ZRangeWithScores ¶
func (*RingPipeline) ZRemRangeByRank ¶
func (*RingPipeline) ZRemRangeByScore ¶
func (*RingPipeline) ZRevRange ¶
func (c *RingPipeline) ZRevRange(key string, start, stop int64) *StringSliceCmd
func (*RingPipeline) ZRevRangeByScore ¶
func (c *RingPipeline) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd
func (*RingPipeline) ZRevRangeByScoreWithScores ¶
func (c *RingPipeline) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd
func (*RingPipeline) ZRevRangeWithScores ¶
type Script ¶
type Script struct {
// contains filtered or unexported fields
}
Example ¶
IncrByXX := redis.NewScript(` if redis.call("GET", KEYS[1]) ~= false then return redis.call("INCRBY", KEYS[1], ARGV[1]) end return false `) n, err := IncrByXX.Run(client, []string{"xx_counter"}, []string{"2"}).Result() fmt.Println(n, err) err = client.Set("xx_counter", "40", 0).Err() if err != nil { panic(err) } n, err = IncrByXX.Run(client, []string{"xx_counter"}, []string{"2"}).Result() fmt.Println(n, err)
Output: <nil> redis: nil 42 <nil>
func (*Script) Exists ¶
func (s *Script) Exists(c scripter) *BoolSliceCmd
type SliceCmd ¶
type SliceCmd struct {
// contains filtered or unexported fields
}
func NewSliceCmd ¶
type StatusCmd ¶
type StatusCmd struct {
// contains filtered or unexported fields
}
func NewStatusCmd ¶
type StringCmd ¶
type StringCmd struct {
// contains filtered or unexported fields
}
func NewStringCmd ¶
type StringIntMapCmd ¶
type StringIntMapCmd struct {
// contains filtered or unexported fields
}
func NewStringIntMapCmd ¶
func NewStringIntMapCmd(args ...string) *StringIntMapCmd
func (*StringIntMapCmd) String ¶
func (cmd *StringIntMapCmd) String() string
func (*StringIntMapCmd) Val ¶
func (cmd *StringIntMapCmd) Val() map[string]int64
type StringSliceCmd ¶
type StringSliceCmd struct {
// contains filtered or unexported fields
}
func NewStringSliceCmd ¶
func NewStringSliceCmd(args ...string) *StringSliceCmd
func (*StringSliceCmd) Result ¶
func (cmd *StringSliceCmd) Result() ([]string, error)
func (*StringSliceCmd) String ¶
func (cmd *StringSliceCmd) String() string
func (*StringSliceCmd) Val ¶
func (cmd *StringSliceCmd) Val() []string
type StringStringMapCmd ¶
type StringStringMapCmd struct {
// contains filtered or unexported fields
}
func NewStringStringMapCmd ¶
func NewStringStringMapCmd(args ...string) *StringStringMapCmd
func (*StringStringMapCmd) Result ¶
func (cmd *StringStringMapCmd) Result() (map[string]string, error)
func (*StringStringMapCmd) String ¶
func (cmd *StringStringMapCmd) String() string
func (*StringStringMapCmd) Val ¶
func (cmd *StringStringMapCmd) Val() map[string]string
type Subscription ¶
type Subscription struct { // Can be "subscribe", "unsubscribe", "psubscribe" or "punsubscribe". Kind string // Channel name we have subscribed to. Channel string // Number of channels we are currently subscribed to. Count int }
Message received after a successful subscription to channel.
func (*Subscription) String ¶
func (m *Subscription) String() string
type ZRangeByScore ¶
type ZSliceCmd ¶
type ZSliceCmd struct {
// contains filtered or unexported fields
}
func NewZSliceCmd ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
consistenthash
Package consistenthash provides an implementation of a ring hash.
|
Package consistenthash provides an implementation of a ring hash. |