redis
packagemoduleThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
README¶
Redis client for Go
go-redis is brought to you by ⭐uptrace/uptrace.Uptrace is an open source and blazingly fastdistributed tracing backend powered byOpenTelemetry and ClickHouse. Give it a star as well!
Resources
Other projects you may like:
- Bun - fast and simple SQL client for PostgreSQL, MySQL, and SQLite.
- BunRouter - fast and flexible HTTP router for Go.
Ecosystem
Features
- Redis 3 commands except QUIT, MONITOR, and SYNC.
- Automatic connection pooling withcircuit breaker support.
- Pub/Sub.
- Transactions.
- Pipeline andTxPipeline.
- Scripting.
- Timeouts.
- Redis Sentinel.
- Redis Cluster.
- Cluster of Redis Serverswithout using cluster mode and Redis Sentinel.
- Ring.
- Instrumentation.
Installation
go-redis supports 2 last Go versions and requires a Go version withmodules support. So make sure to initialize a Gomodule:
go mod init github.com/my/repoAnd then install go-redis/v8 (notev8 in the import; omitting it is a popular mistake):
go get github.com/go-redis/redis/v8Quickstart
import ( "context" "github.com/go-redis/redis/v8" "fmt")var ctx = context.Background()func ExampleClient() { rdb := redis.NewClient(&redis.Options{ Addr: "localhost:6379", Password: "", // no password set DB: 0, // use default DB }) err := rdb.Set(ctx, "key", "value", 0).Err() if err != nil { panic(err) } val, err := rdb.Get(ctx, "key").Result() if err != nil { panic(err) } fmt.Println("key", val) val2, err := rdb.Get(ctx, "key2").Result() if err == redis.Nil { fmt.Println("key2 does not exist") } else if err != nil { panic(err) } else { fmt.Println("key2", val2) } // Output: key value // key2 does not exist}Look and feel
Some corner cases:
// SET key value EX 10 NXset, err := rdb.SetNX(ctx, "key", "value", 10*time.Second).Result()// SET key value keepttl NXset, err := rdb.SetNX(ctx, "key", "value", redis.KeepTTL).Result()// SORT list LIMIT 0 2 ASCvals, err := rdb.Sort(ctx, "list", &redis.Sort{Offset: 0, Count: 2, Order: "ASC"}).Result()// ZRANGEBYSCORE zset -inf +inf WITHSCORES LIMIT 0 2vals, err := rdb.ZRangeByScoreWithScores(ctx, "zset", &redis.ZRangeBy{ Min: "-inf", Max: "+inf", Offset: 0, Count: 2,}).Result()// ZINTERSTORE out 2 zset1 zset2 WEIGHTS 2 3 AGGREGATE SUMvals, err := rdb.ZInterStore(ctx, "out", &redis.ZStore{ Keys: []string{"zset1", "zset2"}, Weights: []int64{2, 3}}).Result()// EVAL "return {KEYS[1],ARGV[1]}" 1 "key" "hello"vals, err := rdb.Eval(ctx, "return {KEYS[1],ARGV[1]}", []string{"key"}, "hello").Result()// custom commandres, err := rdb.Do(ctx, "set", "key", "value").Result()Run the test
go-redis will start a redis-server and run the test cases.
The paths of redis-server bin file and redis config file are defined inmain_test.go:
var (redisServerBin, _ = filepath.Abs(filepath.Join("testdata", "redis", "src", "redis-server"))redisServerConf, _ = filepath.Abs(filepath.Join("testdata", "redis", "redis.conf")))For local testing, you can change the variables to refer to your local files, or create a soft linkto the corresponding folder for redis-server and copy the config file totestdata/redis/:
ln -s /usr/bin/redis-server ./go-redis/testdata/redis/srccp ./go-redis/testdata/redis.conf ./go-redis/testdata/redis/Lastly, run:
go testContributors
Thanks to all the people who already contributed!
Documentation¶
Overview¶
Package redis implements a Redis client.
Example (CustomCommand)¶
Get := func(ctx context.Context, rdb *redis.Client, key string) *redis.StringCmd {cmd := redis.NewStringCmd(ctx, "get", key)rdb.Process(ctx, cmd)return cmd}v, err := Get(ctx, rdb, "key_does_not_exist").Result()fmt.Printf("%q %s", v, err)Output:"" redis: nil
Example (CustomCommand2)¶
v, err := rdb.Do(ctx, "get", "key_does_not_exist").Text()fmt.Printf("%q %s", v, err)Output:"" redis: nil
Example (Instrumentation)¶
rdb := redis.NewClient(&redis.Options{Addr: ":6379",})rdb.AddHook(redisHook{})rdb.Ping(ctx)Output:starting processing: <ping: >finished processing: <ping: PONG>
Index¶
- Constants
- Variables
- func SetLogger(logger internal.Logging)
- func Version() string
- type BitCount
- type BoolCmd
- func (cmd *BoolCmd) Args() []interface{}
- func (cmd *BoolCmd) Err() error
- func (cmd *BoolCmd) FullName() string
- func (cmd *BoolCmd) Name() string
- func (cmd *BoolCmd) Result() (bool, error)
- func (cmd *BoolCmd) SetErr(e error)
- func (cmd *BoolCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *BoolCmd) SetVal(val bool)
- func (cmd *BoolCmd) String() string
- func (cmd *BoolCmd) Val() bool
- type BoolSliceCmd
- func (cmd *BoolSliceCmd) Args() []interface{}
- func (cmd *BoolSliceCmd) Err() error
- func (cmd *BoolSliceCmd) FullName() string
- func (cmd *BoolSliceCmd) Name() string
- func (cmd *BoolSliceCmd) Result() ([]bool, error)
- func (cmd *BoolSliceCmd) SetErr(e error)
- func (cmd *BoolSliceCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *BoolSliceCmd) SetVal(val []bool)
- func (cmd *BoolSliceCmd) String() string
- func (cmd *BoolSliceCmd) Val() []bool
- type ChannelOption
- type Client
- func (hs *Client) AddHook(hook Hook)
- func (c Client) Append(ctx context.Context, key, value string) *IntCmd
- func (c Client) BLMove(ctx context.Context, source, destination, srcpos, destpos string, ...) *StringCmd
- func (c Client) BLPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func (c Client) BRPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func (c Client) BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) *StringCmd
- func (c Client) BZPopMax(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd
- func (c Client) BZPopMin(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd
- func (c Client) BgRewriteAOF(ctx context.Context) *StatusCmd
- func (c Client) BgSave(ctx context.Context) *StatusCmd
- func (c Client) BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd
- func (c Client) BitField(ctx context.Context, key string, args ...interface{}) *IntSliceCmd
- func (c Client) BitOpAnd(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Client) BitOpNot(ctx context.Context, destKey string, key string) *IntCmd
- func (c Client) BitOpOr(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Client) BitOpXor(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Client) BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd
- func (c Client) ClientGetName(ctx context.Context) *StringCmd
- func (c Client) ClientID(ctx context.Context) *IntCmd
- func (c Client) ClientKill(ctx context.Context, ipPort string) *StatusCmd
- func (c Client) ClientKillByFilter(ctx context.Context, keys ...string) *IntCmd
- func (c Client) ClientList(ctx context.Context) *StringCmd
- func (c Client) ClientPause(ctx context.Context, dur time.Duration) *BoolCmd
- func (c Client) ClientUnblock(ctx context.Context, id int64) *IntCmd
- func (c Client) ClientUnblockWithError(ctx context.Context, id int64) *IntCmd
- func (c Client) Close() error
- func (c Client) ClusterAddSlots(ctx context.Context, slots ...int) *StatusCmd
- func (c Client) ClusterAddSlotsRange(ctx context.Context, min, max int) *StatusCmd
- func (c Client) ClusterCountFailureReports(ctx context.Context, nodeID string) *IntCmd
- func (c Client) ClusterCountKeysInSlot(ctx context.Context, slot int) *IntCmd
- func (c Client) ClusterDelSlots(ctx context.Context, slots ...int) *StatusCmd
- func (c Client) ClusterDelSlotsRange(ctx context.Context, min, max int) *StatusCmd
- func (c Client) ClusterFailover(ctx context.Context) *StatusCmd
- func (c Client) ClusterForget(ctx context.Context, nodeID string) *StatusCmd
- func (c Client) ClusterGetKeysInSlot(ctx context.Context, slot int, count int) *StringSliceCmd
- func (c Client) ClusterInfo(ctx context.Context) *StringCmd
- func (c Client) ClusterKeySlot(ctx context.Context, key string) *IntCmd
- func (c Client) ClusterMeet(ctx context.Context, host, port string) *StatusCmd
- func (c Client) ClusterNodes(ctx context.Context) *StringCmd
- func (c Client) ClusterReplicate(ctx context.Context, nodeID string) *StatusCmd
- func (c Client) ClusterResetHard(ctx context.Context) *StatusCmd
- func (c Client) ClusterResetSoft(ctx context.Context) *StatusCmd
- func (c Client) ClusterSaveConfig(ctx context.Context) *StatusCmd
- func (c Client) ClusterSlaves(ctx context.Context, nodeID string) *StringSliceCmd
- func (c Client) ClusterSlots(ctx context.Context) *ClusterSlotsCmd
- func (c Client) Command(ctx context.Context) *CommandsInfoCmd
- func (c Client) ConfigGet(ctx context.Context, parameter string) *SliceCmd
- func (c Client) ConfigResetStat(ctx context.Context) *StatusCmd
- func (c Client) ConfigRewrite(ctx context.Context) *StatusCmd
- func (c Client) ConfigSet(ctx context.Context, parameter, value string) *StatusCmd
- func (c *Client) Conn(ctx context.Context) *Conn
- func (c *Client) Context() context.Context
- func (c Client) Copy(ctx context.Context, sourceKey, destKey string, db int, replace bool) *IntCmd
- func (c Client) DBSize(ctx context.Context) *IntCmd
- func (c Client) DebugObject(ctx context.Context, key string) *StringCmd
- func (c Client) Decr(ctx context.Context, key string) *IntCmd
- func (c Client) DecrBy(ctx context.Context, key string, decrement int64) *IntCmd
- func (c Client) Del(ctx context.Context, keys ...string) *IntCmd
- func (c *Client) Do(ctx context.Context, args ...interface{}) *Cmd
- func (c Client) Dump(ctx context.Context, key string) *StringCmd
- func (c Client) Echo(ctx context.Context, message interface{}) *StringCmd
- func (c Client) Eval(ctx context.Context, script string, keys []string, args ...interface{}) *Cmd
- func (c Client) EvalSha(ctx context.Context, sha1 string, keys []string, args ...interface{}) *Cmd
- func (c Client) Exists(ctx context.Context, keys ...string) *IntCmd
- func (c Client) Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Client) ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c Client) ExpireGT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Client) ExpireLT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Client) ExpireNX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Client) ExpireXX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Client) FlushAll(ctx context.Context) *StatusCmd
- func (c Client) FlushAllAsync(ctx context.Context) *StatusCmd
- func (c Client) FlushDB(ctx context.Context) *StatusCmd
- func (c Client) FlushDBAsync(ctx context.Context) *StatusCmd
- func (c Client) GeoAdd(ctx context.Context, key string, geoLocation ...*GeoLocation) *IntCmd
- func (c Client) GeoDist(ctx context.Context, key string, member1, member2, unit string) *FloatCmd
- func (c Client) GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd
- func (c Client) GeoPos(ctx context.Context, key string, members ...string) *GeoPosCmd
- func (c Client) GeoRadius(ctx context.Context, key string, longitude, latitude float64, ...) *GeoLocationCmd
- func (c Client) GeoRadiusByMember(ctx context.Context, key, member string, query *GeoRadiusQuery) *GeoLocationCmd
- func (c Client) GeoRadiusByMemberStore(ctx context.Context, key, member string, query *GeoRadiusQuery) *IntCmd
- func (c Client) GeoRadiusStore(ctx context.Context, key string, longitude, latitude float64, ...) *IntCmd
- func (c Client) GeoSearch(ctx context.Context, key string, q *GeoSearchQuery) *StringSliceCmd
- func (c Client) GeoSearchLocation(ctx context.Context, key string, q *GeoSearchLocationQuery) *GeoSearchLocationCmd
- func (c Client) GeoSearchStore(ctx context.Context, key, store string, q *GeoSearchStoreQuery) *IntCmd
- func (c Client) Get(ctx context.Context, key string) *StringCmd
- func (c Client) GetBit(ctx context.Context, key string, offset int64) *IntCmd
- func (c Client) GetDel(ctx context.Context, key string) *StringCmd
- func (c Client) GetEx(ctx context.Context, key string, expiration time.Duration) *StringCmd
- func (c Client) GetRange(ctx context.Context, key string, start, end int64) *StringCmd
- func (c Client) GetSet(ctx context.Context, key string, value interface{}) *StringCmd
- func (c Client) HDel(ctx context.Context, key string, fields ...string) *IntCmd
- func (c Client) HExists(ctx context.Context, key, field string) *BoolCmd
- func (c Client) HGet(ctx context.Context, key, field string) *StringCmd
- func (c Client) HGetAll(ctx context.Context, key string) *StringStringMapCmd
- func (c Client) HIncrBy(ctx context.Context, key, field string, incr int64) *IntCmd
- func (c Client) HIncrByFloat(ctx context.Context, key, field string, incr float64) *FloatCmd
- func (c Client) HKeys(ctx context.Context, key string) *StringSliceCmd
- func (c Client) HLen(ctx context.Context, key string) *IntCmd
- func (c Client) HMGet(ctx context.Context, key string, fields ...string) *SliceCmd
- func (c Client) HMSet(ctx context.Context, key string, values ...interface{}) *BoolCmd
- func (c Client) HRandField(ctx context.Context, key string, count int, withValues bool) *StringSliceCmd
- func (c Client) HScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Client) HSet(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Client) HSetNX(ctx context.Context, key, field string, value interface{}) *BoolCmd
- func (c Client) HVals(ctx context.Context, key string) *StringSliceCmd
- func (c Client) Incr(ctx context.Context, key string) *IntCmd
- func (c Client) IncrBy(ctx context.Context, key string, value int64) *IntCmd
- func (c Client) IncrByFloat(ctx context.Context, key string, value float64) *FloatCmd
- func (c Client) Info(ctx context.Context, section ...string) *StringCmd
- func (c Client) Keys(ctx context.Context, pattern string) *StringSliceCmd
- func (c Client) LIndex(ctx context.Context, key string, index int64) *StringCmd
- func (c Client) LInsert(ctx context.Context, key, op string, pivot, value interface{}) *IntCmd
- func (c Client) LInsertAfter(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func (c Client) LInsertBefore(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func (c Client) LLen(ctx context.Context, key string) *IntCmd
- func (c Client) LMove(ctx context.Context, source, destination, srcpos, destpos string) *StringCmd
- func (c Client) LPop(ctx context.Context, key string) *StringCmd
- func (c Client) LPopCount(ctx context.Context, key string, count int) *StringSliceCmd
- func (c Client) LPos(ctx context.Context, key string, value string, a LPosArgs) *IntCmd
- func (c Client) LPosCount(ctx context.Context, key string, value string, count int64, a LPosArgs) *IntSliceCmd
- func (c Client) LPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Client) LPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Client) LRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Client) LRem(ctx context.Context, key string, count int64, value interface{}) *IntCmd
- func (c Client) LSet(ctx context.Context, key string, index int64, value interface{}) *StatusCmd
- func (c Client) LTrim(ctx context.Context, key string, start, stop int64) *StatusCmd
- func (c Client) LastSave(ctx context.Context) *IntCmd
- func (c Client) MGet(ctx context.Context, keys ...string) *SliceCmd
- func (c Client) MSet(ctx context.Context, values ...interface{}) *StatusCmd
- func (c Client) MSetNX(ctx context.Context, values ...interface{}) *BoolCmd
- func (c Client) MemoryUsage(ctx context.Context, key string, samples ...int) *IntCmd
- func (c Client) Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd
- func (c Client) Move(ctx context.Context, key string, db int) *BoolCmd
- func (c Client) ObjectEncoding(ctx context.Context, key string) *StringCmd
- func (c Client) ObjectIdleTime(ctx context.Context, key string) *DurationCmd
- func (c Client) ObjectRefCount(ctx context.Context, key string) *IntCmd
- func (c *Client) Options() *Options
- func (c Client) PExpire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Client) PExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c Client) PFAdd(ctx context.Context, key string, els ...interface{}) *IntCmd
- func (c Client) PFCount(ctx context.Context, keys ...string) *IntCmd
- func (c Client) PFMerge(ctx context.Context, dest string, keys ...string) *StatusCmd
- func (c *Client) PSubscribe(ctx context.Context, channels ...string) *PubSub
- func (c Client) PTTL(ctx context.Context, key string) *DurationCmd
- func (c Client) Persist(ctx context.Context, key string) *BoolCmd
- func (c Client) Ping(ctx context.Context) *StatusCmd
- func (c *Client) Pipeline() Pipeliner
- func (c *Client) Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- func (c *Client) PoolStats() *PoolStats
- func (c *Client) Process(ctx context.Context, cmd Cmder) error
- func (c Client) PubSubChannels(ctx context.Context, pattern string) *StringSliceCmd
- func (c Client) PubSubNumPat(ctx context.Context) *IntCmd
- func (c Client) PubSubNumSub(ctx context.Context, channels ...string) *StringIntMapCmd
- func (c Client) Publish(ctx context.Context, channel string, message interface{}) *IntCmd
- func (c Client) Quit(_ context.Context) *StatusCmd
- func (c Client) RPop(ctx context.Context, key string) *StringCmd
- func (c Client) RPopCount(ctx context.Context, key string, count int) *StringSliceCmd
- func (c Client) RPopLPush(ctx context.Context, source, destination string) *StringCmd
- func (c Client) RPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Client) RPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Client) RandomKey(ctx context.Context) *StringCmd
- func (c Client) ReadOnly(ctx context.Context) *StatusCmd
- func (c Client) ReadWrite(ctx context.Context) *StatusCmd
- func (c Client) Rename(ctx context.Context, key, newkey string) *StatusCmd
- func (c Client) RenameNX(ctx context.Context, key, newkey string) *BoolCmd
- func (c Client) Restore(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd
- func (c Client) RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd
- func (c Client) SAdd(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Client) SCard(ctx context.Context, key string) *IntCmd
- func (c Client) SDiff(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Client) SDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Client) SInter(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Client) SInterStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Client) SIsMember(ctx context.Context, key string, member interface{}) *BoolCmd
- func (c Client) SMIsMember(ctx context.Context, key string, members ...interface{}) *BoolSliceCmd
- func (c Client) SMembers(ctx context.Context, key string) *StringSliceCmd
- func (c Client) SMembersMap(ctx context.Context, key string) *StringStructMapCmd
- func (c Client) SMove(ctx context.Context, source, destination string, member interface{}) *BoolCmd
- func (c Client) SPop(ctx context.Context, key string) *StringCmd
- func (c Client) SPopN(ctx context.Context, key string, count int64) *StringSliceCmd
- func (c Client) SRandMember(ctx context.Context, key string) *StringCmd
- func (c Client) SRandMemberN(ctx context.Context, key string, count int64) *StringSliceCmd
- func (c Client) SRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Client) SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Client) SUnion(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Client) SUnionStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Client) Save(ctx context.Context) *StatusCmd
- func (c Client) Scan(ctx context.Context, cursor uint64, match string, count int64) *ScanCmd
- func (c Client) ScanType(ctx context.Context, cursor uint64, match string, count int64, keyType string) *ScanCmd
- func (c Client) ScriptExists(ctx context.Context, hashes ...string) *BoolSliceCmd
- func (c Client) ScriptFlush(ctx context.Context) *StatusCmd
- func (c Client) ScriptKill(ctx context.Context) *StatusCmd
- func (c Client) ScriptLoad(ctx context.Context, script string) *StringCmd
- func (c Client) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- func (c Client) SetArgs(ctx context.Context, key string, value interface{}, a SetArgs) *StatusCmd
- func (c Client) SetBit(ctx context.Context, key string, offset int64, value int) *IntCmd
- func (c Client) SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- func (c Client) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func (c Client) SetRange(ctx context.Context, key string, offset int64, value string) *IntCmd
- func (c Client) SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func (c Client) Shutdown(ctx context.Context) *StatusCmd
- func (c Client) ShutdownNoSave(ctx context.Context) *StatusCmd
- func (c Client) ShutdownSave(ctx context.Context) *StatusCmd
- func (c Client) SlaveOf(ctx context.Context, host, port string) *StatusCmd
- func (c Client) SlowLogGet(ctx context.Context, num int64) *SlowLogCmd
- func (c Client) Sort(ctx context.Context, key string, sort *Sort) *StringSliceCmd
- func (c Client) SortInterfaces(ctx context.Context, key string, sort *Sort) *SliceCmd
- func (c Client) SortStore(ctx context.Context, key, store string, sort *Sort) *IntCmd
- func (c Client) StrLen(ctx context.Context, key string) *IntCmd
- func (c Client) String() string
- func (c *Client) Subscribe(ctx context.Context, channels ...string) *PubSub
- func (c Client) Sync(_ context.Context)
- func (c Client) TTL(ctx context.Context, key string) *DurationCmd
- func (c Client) Time(ctx context.Context) *TimeCmd
- func (c Client) Touch(ctx context.Context, keys ...string) *IntCmd
- func (c *Client) TxPipeline() Pipeliner
- func (c *Client) TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- func (c Client) Type(ctx context.Context, key string) *StatusCmd
- func (c Client) Unlink(ctx context.Context, keys ...string) *IntCmd
- func (c Client) Wait(ctx context.Context, numSlaves int, timeout time.Duration) *IntCmd
- func (c *Client) Watch(ctx context.Context, fn func(*Tx) error, keys ...string) error
- func (c *Client) WithContext(ctx context.Context) *Client
- func (c *Client) WithTimeout(timeout time.Duration) *Client
- func (c Client) XAck(ctx context.Context, stream, group string, ids ...string) *IntCmd
- func (c Client) XAdd(ctx context.Context, a *XAddArgs) *StringCmd
- func (c Client) XAutoClaim(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimCmd
- func (c Client) XAutoClaimJustID(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd
- func (c Client) XClaim(ctx context.Context, a *XClaimArgs) *XMessageSliceCmd
- func (c Client) XClaimJustID(ctx context.Context, a *XClaimArgs) *StringSliceCmd
- func (c Client) XDel(ctx context.Context, stream string, ids ...string) *IntCmd
- func (c Client) XGroupCreate(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Client) XGroupCreateConsumer(ctx context.Context, stream, group, consumer string) *IntCmd
- func (c Client) XGroupCreateMkStream(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Client) XGroupDelConsumer(ctx context.Context, stream, group, consumer string) *IntCmd
- func (c Client) XGroupDestroy(ctx context.Context, stream, group string) *IntCmd
- func (c Client) XGroupSetID(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Client) XInfoConsumers(ctx context.Context, key string, group string) *XInfoConsumersCmd
- func (c Client) XInfoGroups(ctx context.Context, key string) *XInfoGroupsCmd
- func (c Client) XInfoStream(ctx context.Context, key string) *XInfoStreamCmd
- func (c Client) XInfoStreamFull(ctx context.Context, key string, count int) *XInfoStreamFullCmd
- func (c Client) XLen(ctx context.Context, stream string) *IntCmd
- func (c Client) XPending(ctx context.Context, stream, group string) *XPendingCmd
- func (c Client) XPendingExt(ctx context.Context, a *XPendingExtArgs) *XPendingExtCmd
- func (c Client) XRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd
- func (c Client) XRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd
- func (c Client) XRead(ctx context.Context, a *XReadArgs) *XStreamSliceCmd
- func (c Client) XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSliceCmd
- func (c Client) XReadStreams(ctx context.Context, streams ...string) *XStreamSliceCmd
- func (c Client) XRevRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd
- func (c Client) XRevRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd
- func (c Client) XTrim(ctx context.Context, key string, maxLen int64) *IntCmddeprecated
- func (c Client) XTrimApprox(ctx context.Context, key string, maxLen int64) *IntCmddeprecated
- func (c Client) XTrimMaxLen(ctx context.Context, key string, maxLen int64) *IntCmd
- func (c Client) XTrimMaxLenApprox(ctx context.Context, key string, maxLen, limit int64) *IntCmd
- func (c Client) XTrimMinID(ctx context.Context, key string, minID string) *IntCmd
- func (c Client) XTrimMinIDApprox(ctx context.Context, key string, minID string, limit int64) *IntCmd
- func (c Client) ZAdd(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Client) ZAddArgs(ctx context.Context, key string, args ZAddArgs) *IntCmd
- func (c Client) ZAddArgsIncr(ctx context.Context, key string, args ZAddArgs) *FloatCmd
- func (c Client) ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Client) ZAddNX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Client) ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Client) ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Client) ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Client) ZCard(ctx context.Context, key string) *IntCmd
- func (c Client) ZCount(ctx context.Context, key, min, max string) *IntCmd
- func (c Client) ZDiff(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Client) ZDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Client) ZDiffWithScores(ctx context.Context, keys ...string) *ZSliceCmd
- func (c Client) ZIncr(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Client) ZIncrBy(ctx context.Context, key string, increment float64, member string) *FloatCmd
- func (c Client) ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Client) ZIncrXX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Client) ZInter(ctx context.Context, store *ZStore) *StringSliceCmd
- func (c Client) ZInterStore(ctx context.Context, destination string, store *ZStore) *IntCmd
- func (c Client) ZInterWithScores(ctx context.Context, store *ZStore) *ZSliceCmd
- func (c Client) ZLexCount(ctx context.Context, key, min, max string) *IntCmd
- func (c Client) ZMScore(ctx context.Context, key string, members ...string) *FloatSliceCmd
- func (c Client) ZPopMax(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func (c Client) ZPopMin(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func (c Client) ZRandMember(ctx context.Context, key string, count int, withScores bool) *StringSliceCmd
- func (c Client) ZRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Client) ZRangeArgs(ctx context.Context, z ZRangeArgs) *StringSliceCmd
- func (c Client) ZRangeArgsWithScores(ctx context.Context, z ZRangeArgs) *ZSliceCmd
- func (c Client) ZRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Client) ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Client) ZRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c Client) ZRangeStore(ctx context.Context, dst string, z ZRangeArgs) *IntCmd
- func (c Client) ZRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c Client) ZRank(ctx context.Context, key, member string) *IntCmd
- func (c Client) ZRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Client) ZRemRangeByLex(ctx context.Context, key, min, max string) *IntCmd
- func (c Client) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) *IntCmd
- func (c Client) ZRemRangeByScore(ctx context.Context, key, min, max string) *IntCmd
- func (c Client) ZRevRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Client) ZRevRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Client) ZRevRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Client) ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c Client) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c Client) ZRevRank(ctx context.Context, key, member string) *IntCmd
- func (c Client) ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Client) ZScore(ctx context.Context, key, member string) *FloatCmd
- func (c Client) ZUnion(ctx context.Context, store ZStore) *StringSliceCmd
- func (c Client) ZUnionStore(ctx context.Context, dest string, store *ZStore) *IntCmd
- func (c Client) ZUnionWithScores(ctx context.Context, store ZStore) *ZSliceCmd
- type ClusterClient
- func (hs *ClusterClient) AddHook(hook Hook)
- func (c ClusterClient) Append(ctx context.Context, key, value string) *IntCmd
- func (c ClusterClient) BLMove(ctx context.Context, source, destination, srcpos, destpos string, ...) *StringCmd
- func (c ClusterClient) BLPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func (c ClusterClient) BRPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func (c ClusterClient) BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) *StringCmd
- func (c ClusterClient) BZPopMax(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd
- func (c ClusterClient) BZPopMin(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd
- func (c ClusterClient) BgRewriteAOF(ctx context.Context) *StatusCmd
- func (c ClusterClient) BgSave(ctx context.Context) *StatusCmd
- func (c ClusterClient) BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd
- func (c ClusterClient) BitField(ctx context.Context, key string, args ...interface{}) *IntSliceCmd
- func (c ClusterClient) BitOpAnd(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c ClusterClient) BitOpNot(ctx context.Context, destKey string, key string) *IntCmd
- func (c ClusterClient) BitOpOr(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c ClusterClient) BitOpXor(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c ClusterClient) BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd
- func (c ClusterClient) ClientGetName(ctx context.Context) *StringCmd
- func (c ClusterClient) ClientID(ctx context.Context) *IntCmd
- func (c ClusterClient) ClientKill(ctx context.Context, ipPort string) *StatusCmd
- func (c ClusterClient) ClientKillByFilter(ctx context.Context, keys ...string) *IntCmd
- func (c ClusterClient) ClientList(ctx context.Context) *StringCmd
- func (c ClusterClient) ClientPause(ctx context.Context, dur time.Duration) *BoolCmd
- func (c ClusterClient) ClientUnblock(ctx context.Context, id int64) *IntCmd
- func (c ClusterClient) ClientUnblockWithError(ctx context.Context, id int64) *IntCmd
- func (c *ClusterClient) Close() error
- func (c ClusterClient) ClusterAddSlots(ctx context.Context, slots ...int) *StatusCmd
- func (c ClusterClient) ClusterAddSlotsRange(ctx context.Context, min, max int) *StatusCmd
- func (c ClusterClient) ClusterCountFailureReports(ctx context.Context, nodeID string) *IntCmd
- func (c ClusterClient) ClusterCountKeysInSlot(ctx context.Context, slot int) *IntCmd
- func (c ClusterClient) ClusterDelSlots(ctx context.Context, slots ...int) *StatusCmd
- func (c ClusterClient) ClusterDelSlotsRange(ctx context.Context, min, max int) *StatusCmd
- func (c ClusterClient) ClusterFailover(ctx context.Context) *StatusCmd
- func (c ClusterClient) ClusterForget(ctx context.Context, nodeID string) *StatusCmd
- func (c ClusterClient) ClusterGetKeysInSlot(ctx context.Context, slot int, count int) *StringSliceCmd
- func (c ClusterClient) ClusterInfo(ctx context.Context) *StringCmd
- func (c ClusterClient) ClusterKeySlot(ctx context.Context, key string) *IntCmd
- func (c ClusterClient) ClusterMeet(ctx context.Context, host, port string) *StatusCmd
- func (c ClusterClient) ClusterNodes(ctx context.Context) *StringCmd
- func (c ClusterClient) ClusterReplicate(ctx context.Context, nodeID string) *StatusCmd
- func (c ClusterClient) ClusterResetHard(ctx context.Context) *StatusCmd
- func (c ClusterClient) ClusterResetSoft(ctx context.Context) *StatusCmd
- func (c ClusterClient) ClusterSaveConfig(ctx context.Context) *StatusCmd
- func (c ClusterClient) ClusterSlaves(ctx context.Context, nodeID string) *StringSliceCmd
- func (c ClusterClient) ClusterSlots(ctx context.Context) *ClusterSlotsCmd
- func (c ClusterClient) Command(ctx context.Context) *CommandsInfoCmd
- func (c ClusterClient) ConfigGet(ctx context.Context, parameter string) *SliceCmd
- func (c ClusterClient) ConfigResetStat(ctx context.Context) *StatusCmd
- func (c ClusterClient) ConfigRewrite(ctx context.Context) *StatusCmd
- func (c ClusterClient) ConfigSet(ctx context.Context, parameter, value string) *StatusCmd
- func (c *ClusterClient) Context() context.Context
- func (c ClusterClient) Copy(ctx context.Context, sourceKey, destKey string, db int, replace bool) *IntCmd
- func (c *ClusterClient) DBSize(ctx context.Context) *IntCmd
- func (c ClusterClient) DebugObject(ctx context.Context, key string) *StringCmd
- func (c ClusterClient) Decr(ctx context.Context, key string) *IntCmd
- func (c ClusterClient) DecrBy(ctx context.Context, key string, decrement int64) *IntCmd
- func (c ClusterClient) Del(ctx context.Context, keys ...string) *IntCmd
- func (c *ClusterClient) Do(ctx context.Context, args ...interface{}) *Cmd
- func (c ClusterClient) Dump(ctx context.Context, key string) *StringCmd
- func (c ClusterClient) Echo(ctx context.Context, message interface{}) *StringCmd
- func (c ClusterClient) Eval(ctx context.Context, script string, keys []string, args ...interface{}) *Cmd
- func (c ClusterClient) EvalSha(ctx context.Context, sha1 string, keys []string, args ...interface{}) *Cmd
- func (c ClusterClient) Exists(ctx context.Context, keys ...string) *IntCmd
- func (c ClusterClient) Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c ClusterClient) ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c ClusterClient) ExpireGT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c ClusterClient) ExpireLT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c ClusterClient) ExpireNX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c ClusterClient) ExpireXX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c ClusterClient) FlushAll(ctx context.Context) *StatusCmd
- func (c ClusterClient) FlushAllAsync(ctx context.Context) *StatusCmd
- func (c ClusterClient) FlushDB(ctx context.Context) *StatusCmd
- func (c ClusterClient) FlushDBAsync(ctx context.Context) *StatusCmd
- func (c *ClusterClient) ForEachMaster(ctx context.Context, fn func(ctx context.Context, client *Client) error) error
- func (c *ClusterClient) ForEachShard(ctx context.Context, fn func(ctx context.Context, client *Client) error) error
- func (c *ClusterClient) ForEachSlave(ctx context.Context, fn func(ctx context.Context, client *Client) error) error
- func (c ClusterClient) GeoAdd(ctx context.Context, key string, geoLocation ...*GeoLocation) *IntCmd
- func (c ClusterClient) GeoDist(ctx context.Context, key string, member1, member2, unit string) *FloatCmd
- func (c ClusterClient) GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd
- func (c ClusterClient) GeoPos(ctx context.Context, key string, members ...string) *GeoPosCmd
- func (c ClusterClient) GeoRadius(ctx context.Context, key string, longitude, latitude float64, ...) *GeoLocationCmd
- func (c ClusterClient) GeoRadiusByMember(ctx context.Context, key, member string, query *GeoRadiusQuery) *GeoLocationCmd
- func (c ClusterClient) GeoRadiusByMemberStore(ctx context.Context, key, member string, query *GeoRadiusQuery) *IntCmd
- func (c ClusterClient) GeoRadiusStore(ctx context.Context, key string, longitude, latitude float64, ...) *IntCmd
- func (c ClusterClient) GeoSearch(ctx context.Context, key string, q *GeoSearchQuery) *StringSliceCmd
- func (c ClusterClient) GeoSearchLocation(ctx context.Context, key string, q *GeoSearchLocationQuery) *GeoSearchLocationCmd
- func (c ClusterClient) GeoSearchStore(ctx context.Context, key, store string, q *GeoSearchStoreQuery) *IntCmd
- func (c ClusterClient) Get(ctx context.Context, key string) *StringCmd
- func (c ClusterClient) GetBit(ctx context.Context, key string, offset int64) *IntCmd
- func (c ClusterClient) GetDel(ctx context.Context, key string) *StringCmd
- func (c ClusterClient) GetEx(ctx context.Context, key string, expiration time.Duration) *StringCmd
- func (c ClusterClient) GetRange(ctx context.Context, key string, start, end int64) *StringCmd
- func (c ClusterClient) GetSet(ctx context.Context, key string, value interface{}) *StringCmd
- func (c ClusterClient) HDel(ctx context.Context, key string, fields ...string) *IntCmd
- func (c ClusterClient) HExists(ctx context.Context, key, field string) *BoolCmd
- func (c ClusterClient) HGet(ctx context.Context, key, field string) *StringCmd
- func (c ClusterClient) HGetAll(ctx context.Context, key string) *StringStringMapCmd
- func (c ClusterClient) HIncrBy(ctx context.Context, key, field string, incr int64) *IntCmd
- func (c ClusterClient) HIncrByFloat(ctx context.Context, key, field string, incr float64) *FloatCmd
- func (c ClusterClient) HKeys(ctx context.Context, key string) *StringSliceCmd
- func (c ClusterClient) HLen(ctx context.Context, key string) *IntCmd
- func (c ClusterClient) HMGet(ctx context.Context, key string, fields ...string) *SliceCmd
- func (c ClusterClient) HMSet(ctx context.Context, key string, values ...interface{}) *BoolCmd
- func (c ClusterClient) HRandField(ctx context.Context, key string, count int, withValues bool) *StringSliceCmd
- func (c ClusterClient) HScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c ClusterClient) HSet(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c ClusterClient) HSetNX(ctx context.Context, key, field string, value interface{}) *BoolCmd
- func (c ClusterClient) HVals(ctx context.Context, key string) *StringSliceCmd
- func (c ClusterClient) Incr(ctx context.Context, key string) *IntCmd
- func (c ClusterClient) IncrBy(ctx context.Context, key string, value int64) *IntCmd
- func (c ClusterClient) IncrByFloat(ctx context.Context, key string, value float64) *FloatCmd
- func (c ClusterClient) Info(ctx context.Context, section ...string) *StringCmd
- func (c ClusterClient) Keys(ctx context.Context, pattern string) *StringSliceCmd
- func (c ClusterClient) LIndex(ctx context.Context, key string, index int64) *StringCmd
- func (c ClusterClient) LInsert(ctx context.Context, key, op string, pivot, value interface{}) *IntCmd
- func (c ClusterClient) LInsertAfter(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func (c ClusterClient) LInsertBefore(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func (c ClusterClient) LLen(ctx context.Context, key string) *IntCmd
- func (c ClusterClient) LMove(ctx context.Context, source, destination, srcpos, destpos string) *StringCmd
- func (c ClusterClient) LPop(ctx context.Context, key string) *StringCmd
- func (c ClusterClient) LPopCount(ctx context.Context, key string, count int) *StringSliceCmd
- func (c ClusterClient) LPos(ctx context.Context, key string, value string, a LPosArgs) *IntCmd
- func (c ClusterClient) LPosCount(ctx context.Context, key string, value string, count int64, a LPosArgs) *IntSliceCmd
- func (c ClusterClient) LPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c ClusterClient) LPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c ClusterClient) LRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c ClusterClient) LRem(ctx context.Context, key string, count int64, value interface{}) *IntCmd
- func (c ClusterClient) LSet(ctx context.Context, key string, index int64, value interface{}) *StatusCmd
- func (c ClusterClient) LTrim(ctx context.Context, key string, start, stop int64) *StatusCmd
- func (c ClusterClient) LastSave(ctx context.Context) *IntCmd
- func (c ClusterClient) MGet(ctx context.Context, keys ...string) *SliceCmd
- func (c ClusterClient) MSet(ctx context.Context, values ...interface{}) *StatusCmd
- func (c ClusterClient) MSetNX(ctx context.Context, values ...interface{}) *BoolCmd
- func (c *ClusterClient) MasterForKey(ctx context.Context, key string) (*Client, error)
- func (c ClusterClient) MemoryUsage(ctx context.Context, key string, samples ...int) *IntCmd
- func (c ClusterClient) Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd
- func (c ClusterClient) Move(ctx context.Context, key string, db int) *BoolCmd
- func (c ClusterClient) ObjectEncoding(ctx context.Context, key string) *StringCmd
- func (c ClusterClient) ObjectIdleTime(ctx context.Context, key string) *DurationCmd
- func (c ClusterClient) ObjectRefCount(ctx context.Context, key string) *IntCmd
- func (c *ClusterClient) Options() *ClusterOptions
- func (c ClusterClient) PExpire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c ClusterClient) PExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c ClusterClient) PFAdd(ctx context.Context, key string, els ...interface{}) *IntCmd
- func (c ClusterClient) PFCount(ctx context.Context, keys ...string) *IntCmd
- func (c ClusterClient) PFMerge(ctx context.Context, dest string, keys ...string) *StatusCmd
- func (c *ClusterClient) PSubscribe(ctx context.Context, channels ...string) *PubSub
- func (c ClusterClient) PTTL(ctx context.Context, key string) *DurationCmd
- func (c ClusterClient) Persist(ctx context.Context, key string) *BoolCmd
- func (c ClusterClient) Ping(ctx context.Context) *StatusCmd
- func (c *ClusterClient) Pipeline() Pipeliner
- func (c *ClusterClient) Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- func (c *ClusterClient) PoolStats() *PoolStats
- func (c *ClusterClient) Process(ctx context.Context, cmd Cmder) error
- func (c ClusterClient) PubSubChannels(ctx context.Context, pattern string) *StringSliceCmd
- func (c ClusterClient) PubSubNumPat(ctx context.Context) *IntCmd
- func (c ClusterClient) PubSubNumSub(ctx context.Context, channels ...string) *StringIntMapCmd
- func (c ClusterClient) Publish(ctx context.Context, channel string, message interface{}) *IntCmd
- func (c ClusterClient) Quit(_ context.Context) *StatusCmd
- func (c ClusterClient) RPop(ctx context.Context, key string) *StringCmd
- func (c ClusterClient) RPopCount(ctx context.Context, key string, count int) *StringSliceCmd
- func (c ClusterClient) RPopLPush(ctx context.Context, source, destination string) *StringCmd
- func (c ClusterClient) RPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c ClusterClient) RPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c ClusterClient) RandomKey(ctx context.Context) *StringCmd
- func (c ClusterClient) ReadOnly(ctx context.Context) *StatusCmd
- func (c ClusterClient) ReadWrite(ctx context.Context) *StatusCmd
- func (c *ClusterClient) ReloadState(ctx context.Context)
- func (c ClusterClient) Rename(ctx context.Context, key, newkey string) *StatusCmd
- func (c ClusterClient) RenameNX(ctx context.Context, key, newkey string) *BoolCmd
- func (c ClusterClient) Restore(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd
- func (c ClusterClient) RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd
- func (c ClusterClient) SAdd(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c ClusterClient) SCard(ctx context.Context, key string) *IntCmd
- func (c ClusterClient) SDiff(ctx context.Context, keys ...string) *StringSliceCmd
- func (c ClusterClient) SDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c ClusterClient) SInter(ctx context.Context, keys ...string) *StringSliceCmd
- func (c ClusterClient) SInterStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c ClusterClient) SIsMember(ctx context.Context, key string, member interface{}) *BoolCmd
- func (c ClusterClient) SMIsMember(ctx context.Context, key string, members ...interface{}) *BoolSliceCmd
- func (c ClusterClient) SMembers(ctx context.Context, key string) *StringSliceCmd
- func (c ClusterClient) SMembersMap(ctx context.Context, key string) *StringStructMapCmd
- func (c ClusterClient) SMove(ctx context.Context, source, destination string, member interface{}) *BoolCmd
- func (c ClusterClient) SPop(ctx context.Context, key string) *StringCmd
- func (c ClusterClient) SPopN(ctx context.Context, key string, count int64) *StringSliceCmd
- func (c ClusterClient) SRandMember(ctx context.Context, key string) *StringCmd
- func (c ClusterClient) SRandMemberN(ctx context.Context, key string, count int64) *StringSliceCmd
- func (c ClusterClient) SRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c ClusterClient) SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c ClusterClient) SUnion(ctx context.Context, keys ...string) *StringSliceCmd
- func (c ClusterClient) SUnionStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c ClusterClient) Save(ctx context.Context) *StatusCmd
- func (c ClusterClient) Scan(ctx context.Context, cursor uint64, match string, count int64) *ScanCmd
- func (c ClusterClient) ScanType(ctx context.Context, cursor uint64, match string, count int64, keyType string) *ScanCmd
- func (c *ClusterClient) ScriptExists(ctx context.Context, hashes ...string) *BoolSliceCmd
- func (c *ClusterClient) ScriptFlush(ctx context.Context) *StatusCmd
- func (c ClusterClient) ScriptKill(ctx context.Context) *StatusCmd
- func (c *ClusterClient) ScriptLoad(ctx context.Context, script string) *StringCmd
- func (c ClusterClient) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- func (c ClusterClient) SetArgs(ctx context.Context, key string, value interface{}, a SetArgs) *StatusCmd
- func (c ClusterClient) SetBit(ctx context.Context, key string, offset int64, value int) *IntCmd
- func (c ClusterClient) SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- func (c ClusterClient) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func (c ClusterClient) SetRange(ctx context.Context, key string, offset int64, value string) *IntCmd
- func (c ClusterClient) SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func (c ClusterClient) Shutdown(ctx context.Context) *StatusCmd
- func (c ClusterClient) ShutdownNoSave(ctx context.Context) *StatusCmd
- func (c ClusterClient) ShutdownSave(ctx context.Context) *StatusCmd
- func (c *ClusterClient) SlaveForKey(ctx context.Context, key string) (*Client, error)
- func (c ClusterClient) SlaveOf(ctx context.Context, host, port string) *StatusCmd
- func (c ClusterClient) SlowLogGet(ctx context.Context, num int64) *SlowLogCmd
- func (c ClusterClient) Sort(ctx context.Context, key string, sort *Sort) *StringSliceCmd
- func (c ClusterClient) SortInterfaces(ctx context.Context, key string, sort *Sort) *SliceCmd
- func (c ClusterClient) SortStore(ctx context.Context, key, store string, sort *Sort) *IntCmd
- func (c ClusterClient) StrLen(ctx context.Context, key string) *IntCmd
- func (c *ClusterClient) Subscribe(ctx context.Context, channels ...string) *PubSub
- func (c ClusterClient) Sync(_ context.Context)
- func (c ClusterClient) TTL(ctx context.Context, key string) *DurationCmd
- func (c ClusterClient) Time(ctx context.Context) *TimeCmd
- func (c ClusterClient) Touch(ctx context.Context, keys ...string) *IntCmd
- func (c *ClusterClient) TxPipeline() Pipeliner
- func (c *ClusterClient) TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- func (c ClusterClient) Type(ctx context.Context, key string) *StatusCmd
- func (c ClusterClient) Unlink(ctx context.Context, keys ...string) *IntCmd
- func (c ClusterClient) Wait(ctx context.Context, numSlaves int, timeout time.Duration) *IntCmd
- func (c *ClusterClient) Watch(ctx context.Context, fn func(*Tx) error, keys ...string) error
- func (c *ClusterClient) WithContext(ctx context.Context) *ClusterClient
- func (c ClusterClient) XAck(ctx context.Context, stream, group string, ids ...string) *IntCmd
- func (c ClusterClient) XAdd(ctx context.Context, a *XAddArgs) *StringCmd
- func (c ClusterClient) XAutoClaim(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimCmd
- func (c ClusterClient) XAutoClaimJustID(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd
- func (c ClusterClient) XClaim(ctx context.Context, a *XClaimArgs) *XMessageSliceCmd
- func (c ClusterClient) XClaimJustID(ctx context.Context, a *XClaimArgs) *StringSliceCmd
- func (c ClusterClient) XDel(ctx context.Context, stream string, ids ...string) *IntCmd
- func (c ClusterClient) XGroupCreate(ctx context.Context, stream, group, start string) *StatusCmd
- func (c ClusterClient) XGroupCreateConsumer(ctx context.Context, stream, group, consumer string) *IntCmd
- func (c ClusterClient) XGroupCreateMkStream(ctx context.Context, stream, group, start string) *StatusCmd
- func (c ClusterClient) XGroupDelConsumer(ctx context.Context, stream, group, consumer string) *IntCmd
- func (c ClusterClient) XGroupDestroy(ctx context.Context, stream, group string) *IntCmd
- func (c ClusterClient) XGroupSetID(ctx context.Context, stream, group, start string) *StatusCmd
- func (c ClusterClient) XInfoConsumers(ctx context.Context, key string, group string) *XInfoConsumersCmd
- func (c ClusterClient) XInfoGroups(ctx context.Context, key string) *XInfoGroupsCmd
- func (c ClusterClient) XInfoStream(ctx context.Context, key string) *XInfoStreamCmd
- func (c ClusterClient) XInfoStreamFull(ctx context.Context, key string, count int) *XInfoStreamFullCmd
- func (c ClusterClient) XLen(ctx context.Context, stream string) *IntCmd
- func (c ClusterClient) XPending(ctx context.Context, stream, group string) *XPendingCmd
- func (c ClusterClient) XPendingExt(ctx context.Context, a *XPendingExtArgs) *XPendingExtCmd
- func (c ClusterClient) XRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd
- func (c ClusterClient) XRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd
- func (c ClusterClient) XRead(ctx context.Context, a *XReadArgs) *XStreamSliceCmd
- func (c ClusterClient) XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSliceCmd
- func (c ClusterClient) XReadStreams(ctx context.Context, streams ...string) *XStreamSliceCmd
- func (c ClusterClient) XRevRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd
- func (c ClusterClient) XRevRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd
- func (c ClusterClient) XTrim(ctx context.Context, key string, maxLen int64) *IntCmddeprecated
- func (c ClusterClient) XTrimApprox(ctx context.Context, key string, maxLen int64) *IntCmddeprecated
- func (c ClusterClient) XTrimMaxLen(ctx context.Context, key string, maxLen int64) *IntCmd
- func (c ClusterClient) XTrimMaxLenApprox(ctx context.Context, key string, maxLen, limit int64) *IntCmd
- func (c ClusterClient) XTrimMinID(ctx context.Context, key string, minID string) *IntCmd
- func (c ClusterClient) XTrimMinIDApprox(ctx context.Context, key string, minID string, limit int64) *IntCmd
- func (c ClusterClient) ZAdd(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c ClusterClient) ZAddArgs(ctx context.Context, key string, args ZAddArgs) *IntCmd
- func (c ClusterClient) ZAddArgsIncr(ctx context.Context, key string, args ZAddArgs) *FloatCmd
- func (c ClusterClient) ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c ClusterClient) ZAddNX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c ClusterClient) ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c ClusterClient) ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c ClusterClient) ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c ClusterClient) ZCard(ctx context.Context, key string) *IntCmd
- func (c ClusterClient) ZCount(ctx context.Context, key, min, max string) *IntCmd
- func (c ClusterClient) ZDiff(ctx context.Context, keys ...string) *StringSliceCmd
- func (c ClusterClient) ZDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c ClusterClient) ZDiffWithScores(ctx context.Context, keys ...string) *ZSliceCmd
- func (c ClusterClient) ZIncr(ctx context.Context, key string, member *Z) *FloatCmd
- func (c ClusterClient) ZIncrBy(ctx context.Context, key string, increment float64, member string) *FloatCmd
- func (c ClusterClient) ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c ClusterClient) ZIncrXX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c ClusterClient) ZInter(ctx context.Context, store *ZStore) *StringSliceCmd
- func (c ClusterClient) ZInterStore(ctx context.Context, destination string, store *ZStore) *IntCmd
- func (c ClusterClient) ZInterWithScores(ctx context.Context, store *ZStore) *ZSliceCmd
- func (c ClusterClient) ZLexCount(ctx context.Context, key, min, max string) *IntCmd
- func (c ClusterClient) ZMScore(ctx context.Context, key string, members ...string) *FloatSliceCmd
- func (c ClusterClient) ZPopMax(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func (c ClusterClient) ZPopMin(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func (c ClusterClient) ZRandMember(ctx context.Context, key string, count int, withScores bool) *StringSliceCmd
- func (c ClusterClient) ZRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c ClusterClient) ZRangeArgs(ctx context.Context, z ZRangeArgs) *StringSliceCmd
- func (c ClusterClient) ZRangeArgsWithScores(ctx context.Context, z ZRangeArgs) *ZSliceCmd
- func (c ClusterClient) ZRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c ClusterClient) ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c ClusterClient) ZRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c ClusterClient) ZRangeStore(ctx context.Context, dst string, z ZRangeArgs) *IntCmd
- func (c ClusterClient) ZRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c ClusterClient) ZRank(ctx context.Context, key, member string) *IntCmd
- func (c ClusterClient) ZRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c ClusterClient) ZRemRangeByLex(ctx context.Context, key, min, max string) *IntCmd
- func (c ClusterClient) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) *IntCmd
- func (c ClusterClient) ZRemRangeByScore(ctx context.Context, key, min, max string) *IntCmd
- func (c ClusterClient) ZRevRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c ClusterClient) ZRevRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c ClusterClient) ZRevRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c ClusterClient) ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c ClusterClient) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c ClusterClient) ZRevRank(ctx context.Context, key, member string) *IntCmd
- func (c ClusterClient) ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c ClusterClient) ZScore(ctx context.Context, key, member string) *FloatCmd
- func (c ClusterClient) ZUnion(ctx context.Context, store ZStore) *StringSliceCmd
- func (c ClusterClient) ZUnionStore(ctx context.Context, dest string, store *ZStore) *IntCmd
- func (c ClusterClient) ZUnionWithScores(ctx context.Context, store ZStore) *ZSliceCmd
- type ClusterNode
- type ClusterOptions
- type ClusterSlot
- type ClusterSlotsCmd
- func (cmd *ClusterSlotsCmd) Args() []interface{}
- func (cmd *ClusterSlotsCmd) Err() error
- func (cmd *ClusterSlotsCmd) FullName() string
- func (cmd *ClusterSlotsCmd) Name() string
- func (cmd *ClusterSlotsCmd) Result() ([]ClusterSlot, error)
- func (cmd *ClusterSlotsCmd) SetErr(e error)
- func (cmd *ClusterSlotsCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *ClusterSlotsCmd) SetVal(val []ClusterSlot)
- func (cmd *ClusterSlotsCmd) String() string
- func (cmd *ClusterSlotsCmd) Val() []ClusterSlot
- type Cmd
- func (cmd *Cmd) Args() []interface{}
- func (cmd *Cmd) Bool() (bool, error)
- func (cmd *Cmd) BoolSlice() ([]bool, error)
- func (cmd *Cmd) Err() error
- func (cmd *Cmd) Float32() (float32, error)
- func (cmd *Cmd) Float32Slice() ([]float32, error)
- func (cmd *Cmd) Float64() (float64, error)
- func (cmd *Cmd) Float64Slice() ([]float64, error)
- func (cmd *Cmd) FullName() string
- func (cmd *Cmd) Int() (int, error)
- func (cmd *Cmd) Int64() (int64, error)
- func (cmd *Cmd) Int64Slice() ([]int64, error)
- func (cmd *Cmd) Name() string
- func (cmd *Cmd) Result() (interface{}, error)
- func (cmd *Cmd) SetErr(e error)
- func (cmd *Cmd) SetFirstKeyPos(keyPos int8)
- func (cmd *Cmd) SetVal(val interface{})
- func (cmd *Cmd) Slice() ([]interface{}, error)
- func (cmd *Cmd) String() string
- func (cmd *Cmd) StringSlice() ([]string, error)
- func (cmd *Cmd) Text() (string, error)
- func (cmd *Cmd) Uint64() (uint64, error)
- func (cmd *Cmd) Uint64Slice() ([]uint64, error)
- func (cmd *Cmd) Val() interface{}
- type Cmdable
- type Cmder
- type CommandInfo
- type CommandsInfoCmd
- func (cmd *CommandsInfoCmd) Args() []interface{}
- func (cmd *CommandsInfoCmd) Err() error
- func (cmd *CommandsInfoCmd) FullName() string
- func (cmd *CommandsInfoCmd) Name() string
- func (cmd *CommandsInfoCmd) Result() (map[string]*CommandInfo, error)
- func (cmd *CommandsInfoCmd) SetErr(e error)
- func (cmd *CommandsInfoCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *CommandsInfoCmd) SetVal(val map[string]*CommandInfo)
- func (cmd *CommandsInfoCmd) String() string
- func (cmd *CommandsInfoCmd) Val() map[string]*CommandInfo
- type Conn
- func (c *Conn) Pipeline() Pipeliner
- func (c *Conn) Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- func (c *Conn) Process(ctx context.Context, cmd Cmder) error
- func (c *Conn) TxPipeline() Pipeliner
- func (c *Conn) TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- type ConsistentHash
- type DurationCmd
- func (cmd *DurationCmd) Args() []interface{}
- func (cmd *DurationCmd) Err() error
- func (cmd *DurationCmd) FullName() string
- func (cmd *DurationCmd) Name() string
- func (cmd *DurationCmd) Result() (time.Duration, error)
- func (cmd *DurationCmd) SetErr(e error)
- func (cmd *DurationCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *DurationCmd) SetVal(val time.Duration)
- func (cmd *DurationCmd) String() string
- func (cmd *DurationCmd) Val() time.Duration
- type Error
- type FailoverOptions
- type FloatCmd
- func (cmd *FloatCmd) Args() []interface{}
- func (cmd *FloatCmd) Err() error
- func (cmd *FloatCmd) FullName() string
- func (cmd *FloatCmd) Name() string
- func (cmd *FloatCmd) Result() (float64, error)
- func (cmd *FloatCmd) SetErr(e error)
- func (cmd *FloatCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *FloatCmd) SetVal(val float64)
- func (cmd *FloatCmd) String() string
- func (cmd *FloatCmd) Val() float64
- type FloatSliceCmd
- func (cmd *FloatSliceCmd) Args() []interface{}
- func (cmd *FloatSliceCmd) Err() error
- func (cmd *FloatSliceCmd) FullName() string
- func (cmd *FloatSliceCmd) Name() string
- func (cmd *FloatSliceCmd) Result() ([]float64, error)
- func (cmd *FloatSliceCmd) SetErr(e error)
- func (cmd *FloatSliceCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *FloatSliceCmd) SetVal(val []float64)
- func (cmd *FloatSliceCmd) String() string
- func (cmd *FloatSliceCmd) Val() []float64
- type GeoLocation
- type GeoLocationCmd
- func (cmd *GeoLocationCmd) Args() []interface{}
- func (cmd *GeoLocationCmd) Err() error
- func (cmd *GeoLocationCmd) FullName() string
- func (cmd *GeoLocationCmd) Name() string
- func (cmd *GeoLocationCmd) Result() ([]GeoLocation, error)
- func (cmd *GeoLocationCmd) SetErr(e error)
- func (cmd *GeoLocationCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *GeoLocationCmd) SetVal(locations []GeoLocation)
- func (cmd *GeoLocationCmd) String() string
- func (cmd *GeoLocationCmd) Val() []GeoLocation
- type GeoPos
- type GeoPosCmd
- func (cmd *GeoPosCmd) Args() []interface{}
- func (cmd *GeoPosCmd) Err() error
- func (cmd *GeoPosCmd) FullName() string
- func (cmd *GeoPosCmd) Name() string
- func (cmd *GeoPosCmd) Result() ([]*GeoPos, error)
- func (cmd *GeoPosCmd) SetErr(e error)
- func (cmd *GeoPosCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *GeoPosCmd) SetVal(val []*GeoPos)
- func (cmd *GeoPosCmd) String() string
- func (cmd *GeoPosCmd) Val() []*GeoPos
- type GeoRadiusQuery
- type GeoSearchLocationCmd
- func (cmd *GeoSearchLocationCmd) Args() []interface{}
- func (cmd *GeoSearchLocationCmd) Err() error
- func (cmd *GeoSearchLocationCmd) FullName() string
- func (cmd *GeoSearchLocationCmd) Name() string
- func (cmd *GeoSearchLocationCmd) Result() ([]GeoLocation, error)
- func (cmd *GeoSearchLocationCmd) SetErr(e error)
- func (cmd *GeoSearchLocationCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *GeoSearchLocationCmd) SetVal(val []GeoLocation)
- func (cmd *GeoSearchLocationCmd) String() string
- func (cmd *GeoSearchLocationCmd) Val() []GeoLocation
- type GeoSearchLocationQuery
- type GeoSearchQuery
- type GeoSearchStoreQuery
- type Hook
- type IntCmd
- func (cmd *IntCmd) Args() []interface{}
- func (cmd *IntCmd) Err() error
- func (cmd *IntCmd) FullName() string
- func (cmd *IntCmd) Name() string
- func (cmd *IntCmd) Result() (int64, error)
- func (cmd *IntCmd) SetErr(e error)
- func (cmd *IntCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *IntCmd) SetVal(val int64)
- func (cmd *IntCmd) String() string
- func (cmd *IntCmd) Uint64() (uint64, error)
- func (cmd *IntCmd) Val() int64
- type IntSliceCmd
- func (cmd *IntSliceCmd) Args() []interface{}
- func (cmd *IntSliceCmd) Err() error
- func (cmd *IntSliceCmd) FullName() string
- func (cmd *IntSliceCmd) Name() string
- func (cmd *IntSliceCmd) Result() ([]int64, error)
- func (cmd *IntSliceCmd) SetErr(e error)
- func (cmd *IntSliceCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *IntSliceCmd) SetVal(val []int64)
- func (cmd *IntSliceCmd) String() string
- func (cmd *IntSliceCmd) Val() []int64
- type LPosArgs
- type Limiter
- type Message
- type Options
- type Pipeline
- func (c Pipeline) Append(ctx context.Context, key, value string) *IntCmd
- func (c Pipeline) Auth(ctx context.Context, password string) *StatusCmd
- func (c Pipeline) AuthACL(ctx context.Context, username, password string) *StatusCmd
- func (c Pipeline) BLMove(ctx context.Context, source, destination, srcpos, destpos string, ...) *StringCmd
- func (c Pipeline) BLPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func (c Pipeline) BRPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func (c Pipeline) BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) *StringCmd
- func (c Pipeline) BZPopMax(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd
- func (c Pipeline) BZPopMin(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd
- func (c Pipeline) BgRewriteAOF(ctx context.Context) *StatusCmd
- func (c Pipeline) BgSave(ctx context.Context) *StatusCmd
- func (c Pipeline) BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd
- func (c Pipeline) BitField(ctx context.Context, key string, args ...interface{}) *IntSliceCmd
- func (c Pipeline) BitOpAnd(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Pipeline) BitOpNot(ctx context.Context, destKey string, key string) *IntCmd
- func (c Pipeline) BitOpOr(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Pipeline) BitOpXor(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Pipeline) BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd
- func (c Pipeline) ClientGetName(ctx context.Context) *StringCmd
- func (c Pipeline) ClientID(ctx context.Context) *IntCmd
- func (c Pipeline) ClientKill(ctx context.Context, ipPort string) *StatusCmd
- func (c Pipeline) ClientKillByFilter(ctx context.Context, keys ...string) *IntCmd
- func (c Pipeline) ClientList(ctx context.Context) *StringCmd
- func (c Pipeline) ClientPause(ctx context.Context, dur time.Duration) *BoolCmd
- func (c Pipeline) ClientSetName(ctx context.Context, name string) *BoolCmd
- func (c Pipeline) ClientUnblock(ctx context.Context, id int64) *IntCmd
- func (c Pipeline) ClientUnblockWithError(ctx context.Context, id int64) *IntCmd
- func (c *Pipeline) Close() error
- func (c Pipeline) ClusterAddSlots(ctx context.Context, slots ...int) *StatusCmd
- func (c Pipeline) ClusterAddSlotsRange(ctx context.Context, min, max int) *StatusCmd
- func (c Pipeline) ClusterCountFailureReports(ctx context.Context, nodeID string) *IntCmd
- func (c Pipeline) ClusterCountKeysInSlot(ctx context.Context, slot int) *IntCmd
- func (c Pipeline) ClusterDelSlots(ctx context.Context, slots ...int) *StatusCmd
- func (c Pipeline) ClusterDelSlotsRange(ctx context.Context, min, max int) *StatusCmd
- func (c Pipeline) ClusterFailover(ctx context.Context) *StatusCmd
- func (c Pipeline) ClusterForget(ctx context.Context, nodeID string) *StatusCmd
- func (c Pipeline) ClusterGetKeysInSlot(ctx context.Context, slot int, count int) *StringSliceCmd
- func (c Pipeline) ClusterInfo(ctx context.Context) *StringCmd
- func (c Pipeline) ClusterKeySlot(ctx context.Context, key string) *IntCmd
- func (c Pipeline) ClusterMeet(ctx context.Context, host, port string) *StatusCmd
- func (c Pipeline) ClusterNodes(ctx context.Context) *StringCmd
- func (c Pipeline) ClusterReplicate(ctx context.Context, nodeID string) *StatusCmd
- func (c Pipeline) ClusterResetHard(ctx context.Context) *StatusCmd
- func (c Pipeline) ClusterResetSoft(ctx context.Context) *StatusCmd
- func (c Pipeline) ClusterSaveConfig(ctx context.Context) *StatusCmd
- func (c Pipeline) ClusterSlaves(ctx context.Context, nodeID string) *StringSliceCmd
- func (c Pipeline) ClusterSlots(ctx context.Context) *ClusterSlotsCmd
- func (c Pipeline) Command(ctx context.Context) *CommandsInfoCmd
- func (c Pipeline) ConfigGet(ctx context.Context, parameter string) *SliceCmd
- func (c Pipeline) ConfigResetStat(ctx context.Context) *StatusCmd
- func (c Pipeline) ConfigRewrite(ctx context.Context) *StatusCmd
- func (c Pipeline) ConfigSet(ctx context.Context, parameter, value string) *StatusCmd
- func (c Pipeline) Copy(ctx context.Context, sourceKey, destKey string, db int, replace bool) *IntCmd
- func (c Pipeline) DBSize(ctx context.Context) *IntCmd
- func (c Pipeline) DebugObject(ctx context.Context, key string) *StringCmd
- func (c Pipeline) Decr(ctx context.Context, key string) *IntCmd
- func (c Pipeline) DecrBy(ctx context.Context, key string, decrement int64) *IntCmd
- func (c Pipeline) Del(ctx context.Context, keys ...string) *IntCmd
- func (c *Pipeline) Discard() error
- func (c *Pipeline) Do(ctx context.Context, args ...interface{}) *Cmd
- func (c Pipeline) Dump(ctx context.Context, key string) *StringCmd
- func (c Pipeline) Echo(ctx context.Context, message interface{}) *StringCmd
- func (c Pipeline) Eval(ctx context.Context, script string, keys []string, args ...interface{}) *Cmd
- func (c Pipeline) EvalSha(ctx context.Context, sha1 string, keys []string, args ...interface{}) *Cmd
- func (c *Pipeline) Exec(ctx context.Context) ([]Cmder, error)
- func (c Pipeline) Exists(ctx context.Context, keys ...string) *IntCmd
- func (c Pipeline) Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Pipeline) ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c Pipeline) ExpireGT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Pipeline) ExpireLT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Pipeline) ExpireNX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Pipeline) ExpireXX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Pipeline) FlushAll(ctx context.Context) *StatusCmd
- func (c Pipeline) FlushAllAsync(ctx context.Context) *StatusCmd
- func (c Pipeline) FlushDB(ctx context.Context) *StatusCmd
- func (c Pipeline) FlushDBAsync(ctx context.Context) *StatusCmd
- func (c Pipeline) GeoAdd(ctx context.Context, key string, geoLocation ...*GeoLocation) *IntCmd
- func (c Pipeline) GeoDist(ctx context.Context, key string, member1, member2, unit string) *FloatCmd
- func (c Pipeline) GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd
- func (c Pipeline) GeoPos(ctx context.Context, key string, members ...string) *GeoPosCmd
- func (c Pipeline) GeoRadius(ctx context.Context, key string, longitude, latitude float64, ...) *GeoLocationCmd
- func (c Pipeline) GeoRadiusByMember(ctx context.Context, key, member string, query *GeoRadiusQuery) *GeoLocationCmd
- func (c Pipeline) GeoRadiusByMemberStore(ctx context.Context, key, member string, query *GeoRadiusQuery) *IntCmd
- func (c Pipeline) GeoRadiusStore(ctx context.Context, key string, longitude, latitude float64, ...) *IntCmd
- func (c Pipeline) GeoSearch(ctx context.Context, key string, q *GeoSearchQuery) *StringSliceCmd
- func (c Pipeline) GeoSearchLocation(ctx context.Context, key string, q *GeoSearchLocationQuery) *GeoSearchLocationCmd
- func (c Pipeline) GeoSearchStore(ctx context.Context, key, store string, q *GeoSearchStoreQuery) *IntCmd
- func (c Pipeline) Get(ctx context.Context, key string) *StringCmd
- func (c Pipeline) GetBit(ctx context.Context, key string, offset int64) *IntCmd
- func (c Pipeline) GetDel(ctx context.Context, key string) *StringCmd
- func (c Pipeline) GetEx(ctx context.Context, key string, expiration time.Duration) *StringCmd
- func (c Pipeline) GetRange(ctx context.Context, key string, start, end int64) *StringCmd
- func (c Pipeline) GetSet(ctx context.Context, key string, value interface{}) *StringCmd
- func (c Pipeline) HDel(ctx context.Context, key string, fields ...string) *IntCmd
- func (c Pipeline) HExists(ctx context.Context, key, field string) *BoolCmd
- func (c Pipeline) HGet(ctx context.Context, key, field string) *StringCmd
- func (c Pipeline) HGetAll(ctx context.Context, key string) *StringStringMapCmd
- func (c Pipeline) HIncrBy(ctx context.Context, key, field string, incr int64) *IntCmd
- func (c Pipeline) HIncrByFloat(ctx context.Context, key, field string, incr float64) *FloatCmd
- func (c Pipeline) HKeys(ctx context.Context, key string) *StringSliceCmd
- func (c Pipeline) HLen(ctx context.Context, key string) *IntCmd
- func (c Pipeline) HMGet(ctx context.Context, key string, fields ...string) *SliceCmd
- func (c Pipeline) HMSet(ctx context.Context, key string, values ...interface{}) *BoolCmd
- func (c Pipeline) HRandField(ctx context.Context, key string, count int, withValues bool) *StringSliceCmd
- func (c Pipeline) HScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Pipeline) HSet(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Pipeline) HSetNX(ctx context.Context, key, field string, value interface{}) *BoolCmd
- func (c Pipeline) HVals(ctx context.Context, key string) *StringSliceCmd
- func (c Pipeline) Incr(ctx context.Context, key string) *IntCmd
- func (c Pipeline) IncrBy(ctx context.Context, key string, value int64) *IntCmd
- func (c Pipeline) IncrByFloat(ctx context.Context, key string, value float64) *FloatCmd
- func (c Pipeline) Info(ctx context.Context, section ...string) *StringCmd
- func (c Pipeline) Keys(ctx context.Context, pattern string) *StringSliceCmd
- func (c Pipeline) LIndex(ctx context.Context, key string, index int64) *StringCmd
- func (c Pipeline) LInsert(ctx context.Context, key, op string, pivot, value interface{}) *IntCmd
- func (c Pipeline) LInsertAfter(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func (c Pipeline) LInsertBefore(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func (c Pipeline) LLen(ctx context.Context, key string) *IntCmd
- func (c Pipeline) LMove(ctx context.Context, source, destination, srcpos, destpos string) *StringCmd
- func (c Pipeline) LPop(ctx context.Context, key string) *StringCmd
- func (c Pipeline) LPopCount(ctx context.Context, key string, count int) *StringSliceCmd
- func (c Pipeline) LPos(ctx context.Context, key string, value string, a LPosArgs) *IntCmd
- func (c Pipeline) LPosCount(ctx context.Context, key string, value string, count int64, a LPosArgs) *IntSliceCmd
- func (c Pipeline) LPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Pipeline) LPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Pipeline) LRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Pipeline) LRem(ctx context.Context, key string, count int64, value interface{}) *IntCmd
- func (c Pipeline) LSet(ctx context.Context, key string, index int64, value interface{}) *StatusCmd
- func (c Pipeline) LTrim(ctx context.Context, key string, start, stop int64) *StatusCmd
- func (c Pipeline) LastSave(ctx context.Context) *IntCmd
- func (c *Pipeline) Len() int
- func (c Pipeline) MGet(ctx context.Context, keys ...string) *SliceCmd
- func (c Pipeline) MSet(ctx context.Context, values ...interface{}) *StatusCmd
- func (c Pipeline) MSetNX(ctx context.Context, values ...interface{}) *BoolCmd
- func (c Pipeline) MemoryUsage(ctx context.Context, key string, samples ...int) *IntCmd
- func (c Pipeline) Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd
- func (c Pipeline) Move(ctx context.Context, key string, db int) *BoolCmd
- func (c Pipeline) ObjectEncoding(ctx context.Context, key string) *StringCmd
- func (c Pipeline) ObjectIdleTime(ctx context.Context, key string) *DurationCmd
- func (c Pipeline) ObjectRefCount(ctx context.Context, key string) *IntCmd
- func (c Pipeline) PExpire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Pipeline) PExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c Pipeline) PFAdd(ctx context.Context, key string, els ...interface{}) *IntCmd
- func (c Pipeline) PFCount(ctx context.Context, keys ...string) *IntCmd
- func (c Pipeline) PFMerge(ctx context.Context, dest string, keys ...string) *StatusCmd
- func (c Pipeline) PTTL(ctx context.Context, key string) *DurationCmd
- func (c Pipeline) Persist(ctx context.Context, key string) *BoolCmd
- func (c Pipeline) Ping(ctx context.Context) *StatusCmd
- func (c *Pipeline) Pipeline() Pipeliner
- func (c *Pipeline) Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- func (c *Pipeline) Process(ctx context.Context, cmd Cmder) error
- func (c Pipeline) PubSubChannels(ctx context.Context, pattern string) *StringSliceCmd
- func (c Pipeline) PubSubNumPat(ctx context.Context) *IntCmd
- func (c Pipeline) PubSubNumSub(ctx context.Context, channels ...string) *StringIntMapCmd
- func (c Pipeline) Publish(ctx context.Context, channel string, message interface{}) *IntCmd
- func (c Pipeline) Quit(_ context.Context) *StatusCmd
- func (c Pipeline) RPop(ctx context.Context, key string) *StringCmd
- func (c Pipeline) RPopCount(ctx context.Context, key string, count int) *StringSliceCmd
- func (c Pipeline) RPopLPush(ctx context.Context, source, destination string) *StringCmd
- func (c Pipeline) RPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Pipeline) RPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Pipeline) RandomKey(ctx context.Context) *StringCmd
- func (c Pipeline) ReadOnly(ctx context.Context) *StatusCmd
- func (c Pipeline) ReadWrite(ctx context.Context) *StatusCmd
- func (c Pipeline) Rename(ctx context.Context, key, newkey string) *StatusCmd
- func (c Pipeline) RenameNX(ctx context.Context, key, newkey string) *BoolCmd
- func (c Pipeline) Restore(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd
- func (c Pipeline) RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd
- func (c Pipeline) SAdd(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Pipeline) SCard(ctx context.Context, key string) *IntCmd
- func (c Pipeline) SDiff(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Pipeline) SDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Pipeline) SInter(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Pipeline) SInterStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Pipeline) SIsMember(ctx context.Context, key string, member interface{}) *BoolCmd
- func (c Pipeline) SMIsMember(ctx context.Context, key string, members ...interface{}) *BoolSliceCmd
- func (c Pipeline) SMembers(ctx context.Context, key string) *StringSliceCmd
- func (c Pipeline) SMembersMap(ctx context.Context, key string) *StringStructMapCmd
- func (c Pipeline) SMove(ctx context.Context, source, destination string, member interface{}) *BoolCmd
- func (c Pipeline) SPop(ctx context.Context, key string) *StringCmd
- func (c Pipeline) SPopN(ctx context.Context, key string, count int64) *StringSliceCmd
- func (c Pipeline) SRandMember(ctx context.Context, key string) *StringCmd
- func (c Pipeline) SRandMemberN(ctx context.Context, key string, count int64) *StringSliceCmd
- func (c Pipeline) SRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Pipeline) SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Pipeline) SUnion(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Pipeline) SUnionStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Pipeline) Save(ctx context.Context) *StatusCmd
- func (c Pipeline) Scan(ctx context.Context, cursor uint64, match string, count int64) *ScanCmd
- func (c Pipeline) ScanType(ctx context.Context, cursor uint64, match string, count int64, keyType string) *ScanCmd
- func (c Pipeline) ScriptExists(ctx context.Context, hashes ...string) *BoolSliceCmd
- func (c Pipeline) ScriptFlush(ctx context.Context) *StatusCmd
- func (c Pipeline) ScriptKill(ctx context.Context) *StatusCmd
- func (c Pipeline) ScriptLoad(ctx context.Context, script string) *StringCmd
- func (c Pipeline) Select(ctx context.Context, index int) *StatusCmd
- func (c Pipeline) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- func (c Pipeline) SetArgs(ctx context.Context, key string, value interface{}, a SetArgs) *StatusCmd
- func (c Pipeline) SetBit(ctx context.Context, key string, offset int64, value int) *IntCmd
- func (c Pipeline) SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- func (c Pipeline) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func (c Pipeline) SetRange(ctx context.Context, key string, offset int64, value string) *IntCmd
- func (c Pipeline) SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func (c Pipeline) Shutdown(ctx context.Context) *StatusCmd
- func (c Pipeline) ShutdownNoSave(ctx context.Context) *StatusCmd
- func (c Pipeline) ShutdownSave(ctx context.Context) *StatusCmd
- func (c Pipeline) SlaveOf(ctx context.Context, host, port string) *StatusCmd
- func (c Pipeline) SlowLogGet(ctx context.Context, num int64) *SlowLogCmd
- func (c Pipeline) Sort(ctx context.Context, key string, sort *Sort) *StringSliceCmd
- func (c Pipeline) SortInterfaces(ctx context.Context, key string, sort *Sort) *SliceCmd
- func (c Pipeline) SortStore(ctx context.Context, key, store string, sort *Sort) *IntCmd
- func (c Pipeline) StrLen(ctx context.Context, key string) *IntCmd
- func (c Pipeline) SwapDB(ctx context.Context, index1, index2 int) *StatusCmd
- func (c Pipeline) Sync(_ context.Context)
- func (c Pipeline) TTL(ctx context.Context, key string) *DurationCmd
- func (c Pipeline) Time(ctx context.Context) *TimeCmd
- func (c Pipeline) Touch(ctx context.Context, keys ...string) *IntCmd
- func (c *Pipeline) TxPipeline() Pipeliner
- func (c *Pipeline) TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- func (c Pipeline) Type(ctx context.Context, key string) *StatusCmd
- func (c Pipeline) Unlink(ctx context.Context, keys ...string) *IntCmd
- func (c Pipeline) Wait(ctx context.Context, numSlaves int, timeout time.Duration) *IntCmd
- func (c Pipeline) XAck(ctx context.Context, stream, group string, ids ...string) *IntCmd
- func (c Pipeline) XAdd(ctx context.Context, a *XAddArgs) *StringCmd
- func (c Pipeline) XAutoClaim(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimCmd
- func (c Pipeline) XAutoClaimJustID(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd
- func (c Pipeline) XClaim(ctx context.Context, a *XClaimArgs) *XMessageSliceCmd
- func (c Pipeline) XClaimJustID(ctx context.Context, a *XClaimArgs) *StringSliceCmd
- func (c Pipeline) XDel(ctx context.Context, stream string, ids ...string) *IntCmd
- func (c Pipeline) XGroupCreate(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Pipeline) XGroupCreateConsumer(ctx context.Context, stream, group, consumer string) *IntCmd
- func (c Pipeline) XGroupCreateMkStream(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Pipeline) XGroupDelConsumer(ctx context.Context, stream, group, consumer string) *IntCmd
- func (c Pipeline) XGroupDestroy(ctx context.Context, stream, group string) *IntCmd
- func (c Pipeline) XGroupSetID(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Pipeline) XInfoConsumers(ctx context.Context, key string, group string) *XInfoConsumersCmd
- func (c Pipeline) XInfoGroups(ctx context.Context, key string) *XInfoGroupsCmd
- func (c Pipeline) XInfoStream(ctx context.Context, key string) *XInfoStreamCmd
- func (c Pipeline) XInfoStreamFull(ctx context.Context, key string, count int) *XInfoStreamFullCmd
- func (c Pipeline) XLen(ctx context.Context, stream string) *IntCmd
- func (c Pipeline) XPending(ctx context.Context, stream, group string) *XPendingCmd
- func (c Pipeline) XPendingExt(ctx context.Context, a *XPendingExtArgs) *XPendingExtCmd
- func (c Pipeline) XRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd
- func (c Pipeline) XRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd
- func (c Pipeline) XRead(ctx context.Context, a *XReadArgs) *XStreamSliceCmd
- func (c Pipeline) XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSliceCmd
- func (c Pipeline) XReadStreams(ctx context.Context, streams ...string) *XStreamSliceCmd
- func (c Pipeline) XRevRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd
- func (c Pipeline) XRevRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd
- func (c Pipeline) XTrim(ctx context.Context, key string, maxLen int64) *IntCmddeprecated
- func (c Pipeline) XTrimApprox(ctx context.Context, key string, maxLen int64) *IntCmddeprecated
- func (c Pipeline) XTrimMaxLen(ctx context.Context, key string, maxLen int64) *IntCmd
- func (c Pipeline) XTrimMaxLenApprox(ctx context.Context, key string, maxLen, limit int64) *IntCmd
- func (c Pipeline) XTrimMinID(ctx context.Context, key string, minID string) *IntCmd
- func (c Pipeline) XTrimMinIDApprox(ctx context.Context, key string, minID string, limit int64) *IntCmd
- func (c Pipeline) ZAdd(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Pipeline) ZAddArgs(ctx context.Context, key string, args ZAddArgs) *IntCmd
- func (c Pipeline) ZAddArgsIncr(ctx context.Context, key string, args ZAddArgs) *FloatCmd
- func (c Pipeline) ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Pipeline) ZAddNX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Pipeline) ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Pipeline) ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Pipeline) ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Pipeline) ZCard(ctx context.Context, key string) *IntCmd
- func (c Pipeline) ZCount(ctx context.Context, key, min, max string) *IntCmd
- func (c Pipeline) ZDiff(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Pipeline) ZDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Pipeline) ZDiffWithScores(ctx context.Context, keys ...string) *ZSliceCmd
- func (c Pipeline) ZIncr(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Pipeline) ZIncrBy(ctx context.Context, key string, increment float64, member string) *FloatCmd
- func (c Pipeline) ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Pipeline) ZIncrXX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Pipeline) ZInter(ctx context.Context, store *ZStore) *StringSliceCmd
- func (c Pipeline) ZInterStore(ctx context.Context, destination string, store *ZStore) *IntCmd
- func (c Pipeline) ZInterWithScores(ctx context.Context, store *ZStore) *ZSliceCmd
- func (c Pipeline) ZLexCount(ctx context.Context, key, min, max string) *IntCmd
- func (c Pipeline) ZMScore(ctx context.Context, key string, members ...string) *FloatSliceCmd
- func (c Pipeline) ZPopMax(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func (c Pipeline) ZPopMin(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func (c Pipeline) ZRandMember(ctx context.Context, key string, count int, withScores bool) *StringSliceCmd
- func (c Pipeline) ZRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Pipeline) ZRangeArgs(ctx context.Context, z ZRangeArgs) *StringSliceCmd
- func (c Pipeline) ZRangeArgsWithScores(ctx context.Context, z ZRangeArgs) *ZSliceCmd
- func (c Pipeline) ZRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Pipeline) ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Pipeline) ZRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c Pipeline) ZRangeStore(ctx context.Context, dst string, z ZRangeArgs) *IntCmd
- func (c Pipeline) ZRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c Pipeline) ZRank(ctx context.Context, key, member string) *IntCmd
- func (c Pipeline) ZRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Pipeline) ZRemRangeByLex(ctx context.Context, key, min, max string) *IntCmd
- func (c Pipeline) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) *IntCmd
- func (c Pipeline) ZRemRangeByScore(ctx context.Context, key, min, max string) *IntCmd
- func (c Pipeline) ZRevRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Pipeline) ZRevRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Pipeline) ZRevRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Pipeline) ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c Pipeline) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c Pipeline) ZRevRank(ctx context.Context, key, member string) *IntCmd
- func (c Pipeline) ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Pipeline) ZScore(ctx context.Context, key, member string) *FloatCmd
- func (c Pipeline) ZUnion(ctx context.Context, store ZStore) *StringSliceCmd
- func (c Pipeline) ZUnionStore(ctx context.Context, dest string, store *ZStore) *IntCmd
- func (c Pipeline) ZUnionWithScores(ctx context.Context, store ZStore) *ZSliceCmd
- type Pipeliner
- type Pong
- type PoolStats
- type PubSub
- func (c *PubSub) Channel(opts ...ChannelOption) <-chan *Message
- func (c *PubSub) ChannelSize(size int) <-chan *Messagedeprecated
- func (c *PubSub) ChannelWithSubscriptions(_ context.Context, size int) <-chan interface{}
- func (c *PubSub) Close() error
- func (c *PubSub) PSubscribe(ctx context.Context, patterns ...string) error
- func (c *PubSub) PUnsubscribe(ctx context.Context, patterns ...string) error
- func (c *PubSub) Ping(ctx context.Context, payload ...string) error
- func (c *PubSub) Receive(ctx context.Context) (interface{}, error)
- func (c *PubSub) ReceiveMessage(ctx context.Context) (*Message, error)
- func (c *PubSub) ReceiveTimeout(ctx context.Context, timeout time.Duration) (interface{}, error)
- func (c *PubSub) String() string
- func (c *PubSub) Subscribe(ctx context.Context, channels ...string) error
- func (c *PubSub) Unsubscribe(ctx context.Context, channels ...string) error
- type Ring
- func (hs *Ring) AddHook(hook Hook)
- func (c Ring) Append(ctx context.Context, key, value string) *IntCmd
- func (c Ring) BLMove(ctx context.Context, source, destination, srcpos, destpos string, ...) *StringCmd
- func (c Ring) BLPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func (c Ring) BRPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func (c Ring) BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) *StringCmd
- func (c Ring) BZPopMax(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd
- func (c Ring) BZPopMin(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd
- func (c Ring) BgRewriteAOF(ctx context.Context) *StatusCmd
- func (c Ring) BgSave(ctx context.Context) *StatusCmd
- func (c Ring) BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd
- func (c Ring) BitField(ctx context.Context, key string, args ...interface{}) *IntSliceCmd
- func (c Ring) BitOpAnd(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Ring) BitOpNot(ctx context.Context, destKey string, key string) *IntCmd
- func (c Ring) BitOpOr(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Ring) BitOpXor(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Ring) BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd
- func (c Ring) ClientGetName(ctx context.Context) *StringCmd
- func (c Ring) ClientID(ctx context.Context) *IntCmd
- func (c Ring) ClientKill(ctx context.Context, ipPort string) *StatusCmd
- func (c Ring) ClientKillByFilter(ctx context.Context, keys ...string) *IntCmd
- func (c Ring) ClientList(ctx context.Context) *StringCmd
- func (c Ring) ClientPause(ctx context.Context, dur time.Duration) *BoolCmd
- func (c Ring) ClientUnblock(ctx context.Context, id int64) *IntCmd
- func (c Ring) ClientUnblockWithError(ctx context.Context, id int64) *IntCmd
- func (c *Ring) Close() error
- func (c Ring) ClusterAddSlots(ctx context.Context, slots ...int) *StatusCmd
- func (c Ring) ClusterAddSlotsRange(ctx context.Context, min, max int) *StatusCmd
- func (c Ring) ClusterCountFailureReports(ctx context.Context, nodeID string) *IntCmd
- func (c Ring) ClusterCountKeysInSlot(ctx context.Context, slot int) *IntCmd
- func (c Ring) ClusterDelSlots(ctx context.Context, slots ...int) *StatusCmd
- func (c Ring) ClusterDelSlotsRange(ctx context.Context, min, max int) *StatusCmd
- func (c Ring) ClusterFailover(ctx context.Context) *StatusCmd
- func (c Ring) ClusterForget(ctx context.Context, nodeID string) *StatusCmd
- func (c Ring) ClusterGetKeysInSlot(ctx context.Context, slot int, count int) *StringSliceCmd
- func (c Ring) ClusterInfo(ctx context.Context) *StringCmd
- func (c Ring) ClusterKeySlot(ctx context.Context, key string) *IntCmd
- func (c Ring) ClusterMeet(ctx context.Context, host, port string) *StatusCmd
- func (c Ring) ClusterNodes(ctx context.Context) *StringCmd
- func (c Ring) ClusterReplicate(ctx context.Context, nodeID string) *StatusCmd
- func (c Ring) ClusterResetHard(ctx context.Context) *StatusCmd
- func (c Ring) ClusterResetSoft(ctx context.Context) *StatusCmd
- func (c Ring) ClusterSaveConfig(ctx context.Context) *StatusCmd
- func (c Ring) ClusterSlaves(ctx context.Context, nodeID string) *StringSliceCmd
- func (c Ring) ClusterSlots(ctx context.Context) *ClusterSlotsCmd
- func (c Ring) Command(ctx context.Context) *CommandsInfoCmd
- func (c Ring) ConfigGet(ctx context.Context, parameter string) *SliceCmd
- func (c Ring) ConfigResetStat(ctx context.Context) *StatusCmd
- func (c Ring) ConfigRewrite(ctx context.Context) *StatusCmd
- func (c Ring) ConfigSet(ctx context.Context, parameter, value string) *StatusCmd
- func (c *Ring) Context() context.Context
- func (c Ring) Copy(ctx context.Context, sourceKey, destKey string, db int, replace bool) *IntCmd
- func (c Ring) DBSize(ctx context.Context) *IntCmd
- func (c Ring) DebugObject(ctx context.Context, key string) *StringCmd
- func (c Ring) Decr(ctx context.Context, key string) *IntCmd
- func (c Ring) DecrBy(ctx context.Context, key string, decrement int64) *IntCmd
- func (c Ring) Del(ctx context.Context, keys ...string) *IntCmd
- func (c *Ring) Do(ctx context.Context, args ...interface{}) *Cmd
- func (c Ring) Dump(ctx context.Context, key string) *StringCmd
- func (c Ring) Echo(ctx context.Context, message interface{}) *StringCmd
- func (c Ring) Eval(ctx context.Context, script string, keys []string, args ...interface{}) *Cmd
- func (c Ring) EvalSha(ctx context.Context, sha1 string, keys []string, args ...interface{}) *Cmd
- func (c Ring) Exists(ctx context.Context, keys ...string) *IntCmd
- func (c Ring) Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Ring) ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c Ring) ExpireGT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Ring) ExpireLT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Ring) ExpireNX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Ring) ExpireXX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Ring) FlushAll(ctx context.Context) *StatusCmd
- func (c Ring) FlushAllAsync(ctx context.Context) *StatusCmd
- func (c Ring) FlushDB(ctx context.Context) *StatusCmd
- func (c Ring) FlushDBAsync(ctx context.Context) *StatusCmd
- func (c *Ring) ForEachShard(ctx context.Context, fn func(ctx context.Context, client *Client) error) error
- func (c Ring) GeoAdd(ctx context.Context, key string, geoLocation ...*GeoLocation) *IntCmd
- func (c Ring) GeoDist(ctx context.Context, key string, member1, member2, unit string) *FloatCmd
- func (c Ring) GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd
- func (c Ring) GeoPos(ctx context.Context, key string, members ...string) *GeoPosCmd
- func (c Ring) GeoRadius(ctx context.Context, key string, longitude, latitude float64, ...) *GeoLocationCmd
- func (c Ring) GeoRadiusByMember(ctx context.Context, key, member string, query *GeoRadiusQuery) *GeoLocationCmd
- func (c Ring) GeoRadiusByMemberStore(ctx context.Context, key, member string, query *GeoRadiusQuery) *IntCmd
- func (c Ring) GeoRadiusStore(ctx context.Context, key string, longitude, latitude float64, ...) *IntCmd
- func (c Ring) GeoSearch(ctx context.Context, key string, q *GeoSearchQuery) *StringSliceCmd
- func (c Ring) GeoSearchLocation(ctx context.Context, key string, q *GeoSearchLocationQuery) *GeoSearchLocationCmd
- func (c Ring) GeoSearchStore(ctx context.Context, key, store string, q *GeoSearchStoreQuery) *IntCmd
- func (c Ring) Get(ctx context.Context, key string) *StringCmd
- func (c Ring) GetBit(ctx context.Context, key string, offset int64) *IntCmd
- func (c Ring) GetDel(ctx context.Context, key string) *StringCmd
- func (c Ring) GetEx(ctx context.Context, key string, expiration time.Duration) *StringCmd
- func (c Ring) GetRange(ctx context.Context, key string, start, end int64) *StringCmd
- func (c Ring) GetSet(ctx context.Context, key string, value interface{}) *StringCmd
- func (c Ring) HDel(ctx context.Context, key string, fields ...string) *IntCmd
- func (c Ring) HExists(ctx context.Context, key, field string) *BoolCmd
- func (c Ring) HGet(ctx context.Context, key, field string) *StringCmd
- func (c Ring) HGetAll(ctx context.Context, key string) *StringStringMapCmd
- func (c Ring) HIncrBy(ctx context.Context, key, field string, incr int64) *IntCmd
- func (c Ring) HIncrByFloat(ctx context.Context, key, field string, incr float64) *FloatCmd
- func (c Ring) HKeys(ctx context.Context, key string) *StringSliceCmd
- func (c Ring) HLen(ctx context.Context, key string) *IntCmd
- func (c Ring) HMGet(ctx context.Context, key string, fields ...string) *SliceCmd
- func (c Ring) HMSet(ctx context.Context, key string, values ...interface{}) *BoolCmd
- func (c Ring) HRandField(ctx context.Context, key string, count int, withValues bool) *StringSliceCmd
- func (c Ring) HScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Ring) HSet(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Ring) HSetNX(ctx context.Context, key, field string, value interface{}) *BoolCmd
- func (c Ring) HVals(ctx context.Context, key string) *StringSliceCmd
- func (c Ring) Incr(ctx context.Context, key string) *IntCmd
- func (c Ring) IncrBy(ctx context.Context, key string, value int64) *IntCmd
- func (c Ring) IncrByFloat(ctx context.Context, key string, value float64) *FloatCmd
- func (c Ring) Info(ctx context.Context, section ...string) *StringCmd
- func (c Ring) Keys(ctx context.Context, pattern string) *StringSliceCmd
- func (c Ring) LIndex(ctx context.Context, key string, index int64) *StringCmd
- func (c Ring) LInsert(ctx context.Context, key, op string, pivot, value interface{}) *IntCmd
- func (c Ring) LInsertAfter(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func (c Ring) LInsertBefore(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func (c Ring) LLen(ctx context.Context, key string) *IntCmd
- func (c Ring) LMove(ctx context.Context, source, destination, srcpos, destpos string) *StringCmd
- func (c Ring) LPop(ctx context.Context, key string) *StringCmd
- func (c Ring) LPopCount(ctx context.Context, key string, count int) *StringSliceCmd
- func (c Ring) LPos(ctx context.Context, key string, value string, a LPosArgs) *IntCmd
- func (c Ring) LPosCount(ctx context.Context, key string, value string, count int64, a LPosArgs) *IntSliceCmd
- func (c Ring) LPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Ring) LPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Ring) LRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Ring) LRem(ctx context.Context, key string, count int64, value interface{}) *IntCmd
- func (c Ring) LSet(ctx context.Context, key string, index int64, value interface{}) *StatusCmd
- func (c Ring) LTrim(ctx context.Context, key string, start, stop int64) *StatusCmd
- func (c Ring) LastSave(ctx context.Context) *IntCmd
- func (c *Ring) Len() int
- func (c Ring) MGet(ctx context.Context, keys ...string) *SliceCmd
- func (c Ring) MSet(ctx context.Context, values ...interface{}) *StatusCmd
- func (c Ring) MSetNX(ctx context.Context, values ...interface{}) *BoolCmd
- func (c Ring) MemoryUsage(ctx context.Context, key string, samples ...int) *IntCmd
- func (c Ring) Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd
- func (c Ring) Move(ctx context.Context, key string, db int) *BoolCmd
- func (c Ring) ObjectEncoding(ctx context.Context, key string) *StringCmd
- func (c Ring) ObjectIdleTime(ctx context.Context, key string) *DurationCmd
- func (c Ring) ObjectRefCount(ctx context.Context, key string) *IntCmd
- func (c *Ring) Options() *RingOptions
- func (c Ring) PExpire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Ring) PExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c Ring) PFAdd(ctx context.Context, key string, els ...interface{}) *IntCmd
- func (c Ring) PFCount(ctx context.Context, keys ...string) *IntCmd
- func (c Ring) PFMerge(ctx context.Context, dest string, keys ...string) *StatusCmd
- func (c *Ring) PSubscribe(ctx context.Context, channels ...string) *PubSub
- func (c Ring) PTTL(ctx context.Context, key string) *DurationCmd
- func (c Ring) Persist(ctx context.Context, key string) *BoolCmd
- func (c Ring) Ping(ctx context.Context) *StatusCmd
- func (c *Ring) Pipeline() Pipeliner
- func (c *Ring) Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- func (c *Ring) PoolStats() *PoolStats
- func (c *Ring) Process(ctx context.Context, cmd Cmder) error
- func (c Ring) PubSubChannels(ctx context.Context, pattern string) *StringSliceCmd
- func (c Ring) PubSubNumPat(ctx context.Context) *IntCmd
- func (c Ring) PubSubNumSub(ctx context.Context, channels ...string) *StringIntMapCmd
- func (c Ring) Publish(ctx context.Context, channel string, message interface{}) *IntCmd
- func (c Ring) Quit(_ context.Context) *StatusCmd
- func (c Ring) RPop(ctx context.Context, key string) *StringCmd
- func (c Ring) RPopCount(ctx context.Context, key string, count int) *StringSliceCmd
- func (c Ring) RPopLPush(ctx context.Context, source, destination string) *StringCmd
- func (c Ring) RPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Ring) RPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Ring) RandomKey(ctx context.Context) *StringCmd
- func (c Ring) ReadOnly(ctx context.Context) *StatusCmd
- func (c Ring) ReadWrite(ctx context.Context) *StatusCmd
- func (c Ring) Rename(ctx context.Context, key, newkey string) *StatusCmd
- func (c Ring) RenameNX(ctx context.Context, key, newkey string) *BoolCmd
- func (c Ring) Restore(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd
- func (c Ring) RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd
- func (c Ring) SAdd(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Ring) SCard(ctx context.Context, key string) *IntCmd
- func (c Ring) SDiff(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Ring) SDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Ring) SInter(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Ring) SInterStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Ring) SIsMember(ctx context.Context, key string, member interface{}) *BoolCmd
- func (c Ring) SMIsMember(ctx context.Context, key string, members ...interface{}) *BoolSliceCmd
- func (c Ring) SMembers(ctx context.Context, key string) *StringSliceCmd
- func (c Ring) SMembersMap(ctx context.Context, key string) *StringStructMapCmd
- func (c Ring) SMove(ctx context.Context, source, destination string, member interface{}) *BoolCmd
- func (c Ring) SPop(ctx context.Context, key string) *StringCmd
- func (c Ring) SPopN(ctx context.Context, key string, count int64) *StringSliceCmd
- func (c Ring) SRandMember(ctx context.Context, key string) *StringCmd
- func (c Ring) SRandMemberN(ctx context.Context, key string, count int64) *StringSliceCmd
- func (c Ring) SRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Ring) SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Ring) SUnion(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Ring) SUnionStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Ring) Save(ctx context.Context) *StatusCmd
- func (c Ring) Scan(ctx context.Context, cursor uint64, match string, count int64) *ScanCmd
- func (c Ring) ScanType(ctx context.Context, cursor uint64, match string, count int64, keyType string) *ScanCmd
- func (c Ring) ScriptExists(ctx context.Context, hashes ...string) *BoolSliceCmd
- func (c Ring) ScriptFlush(ctx context.Context) *StatusCmd
- func (c Ring) ScriptKill(ctx context.Context) *StatusCmd
- func (c Ring) ScriptLoad(ctx context.Context, script string) *StringCmd
- func (c Ring) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- func (c Ring) SetArgs(ctx context.Context, key string, value interface{}, a SetArgs) *StatusCmd
- func (c Ring) SetBit(ctx context.Context, key string, offset int64, value int) *IntCmd
- func (c Ring) SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- func (c Ring) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func (c Ring) SetRange(ctx context.Context, key string, offset int64, value string) *IntCmd
- func (c Ring) SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func (c Ring) Shutdown(ctx context.Context) *StatusCmd
- func (c Ring) ShutdownNoSave(ctx context.Context) *StatusCmd
- func (c Ring) ShutdownSave(ctx context.Context) *StatusCmd
- func (c Ring) SlaveOf(ctx context.Context, host, port string) *StatusCmd
- func (c Ring) SlowLogGet(ctx context.Context, num int64) *SlowLogCmd
- func (c Ring) Sort(ctx context.Context, key string, sort *Sort) *StringSliceCmd
- func (c Ring) SortInterfaces(ctx context.Context, key string, sort *Sort) *SliceCmd
- func (c Ring) SortStore(ctx context.Context, key, store string, sort *Sort) *IntCmd
- func (c Ring) StrLen(ctx context.Context, key string) *IntCmd
- func (c *Ring) Subscribe(ctx context.Context, channels ...string) *PubSub
- func (c Ring) Sync(_ context.Context)
- func (c Ring) TTL(ctx context.Context, key string) *DurationCmd
- func (c Ring) Time(ctx context.Context) *TimeCmd
- func (c Ring) Touch(ctx context.Context, keys ...string) *IntCmd
- func (c *Ring) TxPipeline() Pipeliner
- func (c *Ring) TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- func (c Ring) Type(ctx context.Context, key string) *StatusCmd
- func (c Ring) Unlink(ctx context.Context, keys ...string) *IntCmd
- func (c Ring) Wait(ctx context.Context, numSlaves int, timeout time.Duration) *IntCmd
- func (c *Ring) Watch(ctx context.Context, fn func(*Tx) error, keys ...string) error
- func (c *Ring) WithContext(ctx context.Context) *Ring
- func (c Ring) XAck(ctx context.Context, stream, group string, ids ...string) *IntCmd
- func (c Ring) XAdd(ctx context.Context, a *XAddArgs) *StringCmd
- func (c Ring) XAutoClaim(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimCmd
- func (c Ring) XAutoClaimJustID(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd
- func (c Ring) XClaim(ctx context.Context, a *XClaimArgs) *XMessageSliceCmd
- func (c Ring) XClaimJustID(ctx context.Context, a *XClaimArgs) *StringSliceCmd
- func (c Ring) XDel(ctx context.Context, stream string, ids ...string) *IntCmd
- func (c Ring) XGroupCreate(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Ring) XGroupCreateConsumer(ctx context.Context, stream, group, consumer string) *IntCmd
- func (c Ring) XGroupCreateMkStream(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Ring) XGroupDelConsumer(ctx context.Context, stream, group, consumer string) *IntCmd
- func (c Ring) XGroupDestroy(ctx context.Context, stream, group string) *IntCmd
- func (c Ring) XGroupSetID(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Ring) XInfoConsumers(ctx context.Context, key string, group string) *XInfoConsumersCmd
- func (c Ring) XInfoGroups(ctx context.Context, key string) *XInfoGroupsCmd
- func (c Ring) XInfoStream(ctx context.Context, key string) *XInfoStreamCmd
- func (c Ring) XInfoStreamFull(ctx context.Context, key string, count int) *XInfoStreamFullCmd
- func (c Ring) XLen(ctx context.Context, stream string) *IntCmd
- func (c Ring) XPending(ctx context.Context, stream, group string) *XPendingCmd
- func (c Ring) XPendingExt(ctx context.Context, a *XPendingExtArgs) *XPendingExtCmd
- func (c Ring) XRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd
- func (c Ring) XRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd
- func (c Ring) XRead(ctx context.Context, a *XReadArgs) *XStreamSliceCmd
- func (c Ring) XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSliceCmd
- func (c Ring) XReadStreams(ctx context.Context, streams ...string) *XStreamSliceCmd
- func (c Ring) XRevRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd
- func (c Ring) XRevRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd
- func (c Ring) XTrim(ctx context.Context, key string, maxLen int64) *IntCmddeprecated
- func (c Ring) XTrimApprox(ctx context.Context, key string, maxLen int64) *IntCmddeprecated
- func (c Ring) XTrimMaxLen(ctx context.Context, key string, maxLen int64) *IntCmd
- func (c Ring) XTrimMaxLenApprox(ctx context.Context, key string, maxLen, limit int64) *IntCmd
- func (c Ring) XTrimMinID(ctx context.Context, key string, minID string) *IntCmd
- func (c Ring) XTrimMinIDApprox(ctx context.Context, key string, minID string, limit int64) *IntCmd
- func (c Ring) ZAdd(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Ring) ZAddArgs(ctx context.Context, key string, args ZAddArgs) *IntCmd
- func (c Ring) ZAddArgsIncr(ctx context.Context, key string, args ZAddArgs) *FloatCmd
- func (c Ring) ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Ring) ZAddNX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Ring) ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Ring) ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Ring) ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Ring) ZCard(ctx context.Context, key string) *IntCmd
- func (c Ring) ZCount(ctx context.Context, key, min, max string) *IntCmd
- func (c Ring) ZDiff(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Ring) ZDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Ring) ZDiffWithScores(ctx context.Context, keys ...string) *ZSliceCmd
- func (c Ring) ZIncr(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Ring) ZIncrBy(ctx context.Context, key string, increment float64, member string) *FloatCmd
- func (c Ring) ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Ring) ZIncrXX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Ring) ZInter(ctx context.Context, store *ZStore) *StringSliceCmd
- func (c Ring) ZInterStore(ctx context.Context, destination string, store *ZStore) *IntCmd
- func (c Ring) ZInterWithScores(ctx context.Context, store *ZStore) *ZSliceCmd
- func (c Ring) ZLexCount(ctx context.Context, key, min, max string) *IntCmd
- func (c Ring) ZMScore(ctx context.Context, key string, members ...string) *FloatSliceCmd
- func (c Ring) ZPopMax(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func (c Ring) ZPopMin(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func (c Ring) ZRandMember(ctx context.Context, key string, count int, withScores bool) *StringSliceCmd
- func (c Ring) ZRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Ring) ZRangeArgs(ctx context.Context, z ZRangeArgs) *StringSliceCmd
- func (c Ring) ZRangeArgsWithScores(ctx context.Context, z ZRangeArgs) *ZSliceCmd
- func (c Ring) ZRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Ring) ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Ring) ZRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c Ring) ZRangeStore(ctx context.Context, dst string, z ZRangeArgs) *IntCmd
- func (c Ring) ZRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c Ring) ZRank(ctx context.Context, key, member string) *IntCmd
- func (c Ring) ZRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Ring) ZRemRangeByLex(ctx context.Context, key, min, max string) *IntCmd
- func (c Ring) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) *IntCmd
- func (c Ring) ZRemRangeByScore(ctx context.Context, key, min, max string) *IntCmd
- func (c Ring) ZRevRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Ring) ZRevRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Ring) ZRevRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Ring) ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c Ring) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c Ring) ZRevRank(ctx context.Context, key, member string) *IntCmd
- func (c Ring) ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Ring) ZScore(ctx context.Context, key, member string) *FloatCmd
- func (c Ring) ZUnion(ctx context.Context, store ZStore) *StringSliceCmd
- func (c Ring) ZUnionStore(ctx context.Context, dest string, store *ZStore) *IntCmd
- func (c Ring) ZUnionWithScores(ctx context.Context, store ZStore) *ZSliceCmd
- type RingOptions
- type ScanCmd
- func (cmd *ScanCmd) Args() []interface{}
- func (cmd *ScanCmd) Err() error
- func (cmd *ScanCmd) FullName() string
- func (cmd *ScanCmd) Iterator() *ScanIterator
- func (cmd *ScanCmd) Name() string
- func (cmd *ScanCmd) Result() (keys []string, cursor uint64, err error)
- func (cmd *ScanCmd) SetErr(e error)
- func (cmd *ScanCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *ScanCmd) SetVal(page []string, cursor uint64)
- func (cmd *ScanCmd) String() string
- func (cmd *ScanCmd) Val() (keys []string, cursor uint64)
- type ScanIterator
- type Script
- func (s *Script) Eval(ctx context.Context, c Scripter, keys []string, args ...interface{}) *Cmd
- func (s *Script) EvalSha(ctx context.Context, c Scripter, keys []string, args ...interface{}) *Cmd
- func (s *Script) Exists(ctx context.Context, c Scripter) *BoolSliceCmd
- func (s *Script) Hash() string
- func (s *Script) Load(ctx context.Context, c Scripter) *StringCmd
- func (s *Script) Run(ctx context.Context, c Scripter, keys []string, args ...interface{}) *Cmd
- type Scripter
- type SentinelClient
- func (hs *SentinelClient) AddHook(hook Hook)
- func (c *SentinelClient) CkQuorum(ctx context.Context, name string) *StringCmd
- func (c SentinelClient) Close() error
- func (c *SentinelClient) Context() context.Context
- func (c *SentinelClient) Failover(ctx context.Context, name string) *StatusCmd
- func (c *SentinelClient) FlushConfig(ctx context.Context) *StatusCmd
- func (c *SentinelClient) GetMasterAddrByName(ctx context.Context, name string) *StringSliceCmd
- func (c *SentinelClient) Master(ctx context.Context, name string) *StringStringMapCmd
- func (c *SentinelClient) Masters(ctx context.Context) *SliceCmd
- func (c *SentinelClient) Monitor(ctx context.Context, name, ip, port, quorum string) *StringCmd
- func (c *SentinelClient) PSubscribe(ctx context.Context, channels ...string) *PubSub
- func (c *SentinelClient) Ping(ctx context.Context) *StringCmd
- func (c *SentinelClient) Process(ctx context.Context, cmd Cmder) error
- func (c *SentinelClient) Remove(ctx context.Context, name string) *StringCmd
- func (c *SentinelClient) Reset(ctx context.Context, pattern string) *IntCmd
- func (c *SentinelClient) Sentinels(ctx context.Context, name string) *SliceCmd
- func (c *SentinelClient) Set(ctx context.Context, name, option, value string) *StringCmd
- func (c *SentinelClient) Slaves(ctx context.Context, name string) *SliceCmd
- func (c SentinelClient) String() string
- func (c *SentinelClient) Subscribe(ctx context.Context, channels ...string) *PubSub
- func (c *SentinelClient) WithContext(ctx context.Context) *SentinelClient
- type SetArgs
- type SliceCmd
- func (cmd *SliceCmd) Args() []interface{}
- func (cmd *SliceCmd) Err() error
- func (cmd *SliceCmd) FullName() string
- func (cmd *SliceCmd) Name() string
- func (cmd *SliceCmd) Result() ([]interface{}, error)
- func (cmd *SliceCmd) Scan(dst interface{}) error
- func (cmd *SliceCmd) SetErr(e error)
- func (cmd *SliceCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *SliceCmd) SetVal(val []interface{})
- func (cmd *SliceCmd) String() string
- func (cmd *SliceCmd) Val() []interface{}
- type SlowLog
- type SlowLogCmd
- func (cmd *SlowLogCmd) Args() []interface{}
- func (cmd *SlowLogCmd) Err() error
- func (cmd *SlowLogCmd) FullName() string
- func (cmd *SlowLogCmd) Name() string
- func (cmd *SlowLogCmd) Result() ([]SlowLog, error)
- func (cmd *SlowLogCmd) SetErr(e error)
- func (cmd *SlowLogCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *SlowLogCmd) SetVal(val []SlowLog)
- func (cmd *SlowLogCmd) String() string
- func (cmd *SlowLogCmd) Val() []SlowLog
- type Sort
- type StatefulCmdable
- type StatusCmd
- func (cmd *StatusCmd) Args() []interface{}
- func (cmd *StatusCmd) Err() error
- func (cmd *StatusCmd) FullName() string
- func (cmd *StatusCmd) Name() string
- func (cmd *StatusCmd) Result() (string, error)
- func (cmd *StatusCmd) SetErr(e error)
- func (cmd *StatusCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *StatusCmd) SetVal(val string)
- func (cmd *StatusCmd) String() string
- func (cmd *StatusCmd) Val() string
- type StringCmd
- func (cmd *StringCmd) Args() []interface{}
- func (cmd *StringCmd) Bool() (bool, error)
- func (cmd *StringCmd) Bytes() ([]byte, error)
- func (cmd *StringCmd) Err() error
- func (cmd *StringCmd) Float32() (float32, error)
- func (cmd *StringCmd) Float64() (float64, error)
- func (cmd *StringCmd) FullName() string
- func (cmd *StringCmd) Int() (int, error)
- func (cmd *StringCmd) Int64() (int64, error)
- func (cmd *StringCmd) Name() string
- func (cmd *StringCmd) Result() (string, error)
- func (cmd *StringCmd) Scan(val interface{}) error
- func (cmd *StringCmd) SetErr(e error)
- func (cmd *StringCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *StringCmd) SetVal(val string)
- func (cmd *StringCmd) String() string
- func (cmd *StringCmd) Time() (time.Time, error)
- func (cmd *StringCmd) Uint64() (uint64, error)
- func (cmd *StringCmd) Val() string
- type StringIntMapCmd
- func (cmd *StringIntMapCmd) Args() []interface{}
- func (cmd *StringIntMapCmd) Err() error
- func (cmd *StringIntMapCmd) FullName() string
- func (cmd *StringIntMapCmd) Name() string
- func (cmd *StringIntMapCmd) Result() (map[string]int64, error)
- func (cmd *StringIntMapCmd) SetErr(e error)
- func (cmd *StringIntMapCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *StringIntMapCmd) SetVal(val map[string]int64)
- func (cmd *StringIntMapCmd) String() string
- func (cmd *StringIntMapCmd) Val() map[string]int64
- type StringSliceCmd
- func (cmd *StringSliceCmd) Args() []interface{}
- func (cmd *StringSliceCmd) Err() error
- func (cmd *StringSliceCmd) FullName() string
- func (cmd *StringSliceCmd) Name() string
- func (cmd *StringSliceCmd) Result() ([]string, error)
- func (cmd *StringSliceCmd) ScanSlice(container interface{}) error
- func (cmd *StringSliceCmd) SetErr(e error)
- func (cmd *StringSliceCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *StringSliceCmd) SetVal(val []string)
- func (cmd *StringSliceCmd) String() string
- func (cmd *StringSliceCmd) Val() []string
- type StringStringMapCmd
- func (cmd *StringStringMapCmd) Args() []interface{}
- func (cmd *StringStringMapCmd) Err() error
- func (cmd *StringStringMapCmd) FullName() string
- func (cmd *StringStringMapCmd) Name() string
- func (cmd *StringStringMapCmd) Result() (map[string]string, error)
- func (cmd *StringStringMapCmd) Scan(dest interface{}) error
- func (cmd *StringStringMapCmd) SetErr(e error)
- func (cmd *StringStringMapCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *StringStringMapCmd) SetVal(val map[string]string)
- func (cmd *StringStringMapCmd) String() string
- func (cmd *StringStringMapCmd) Val() map[string]string
- type StringStructMapCmd
- func (cmd *StringStructMapCmd) Args() []interface{}
- func (cmd *StringStructMapCmd) Err() error
- func (cmd *StringStructMapCmd) FullName() string
- func (cmd *StringStructMapCmd) Name() string
- func (cmd *StringStructMapCmd) Result() (map[string]struct{}, error)
- func (cmd *StringStructMapCmd) SetErr(e error)
- func (cmd *StringStructMapCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *StringStructMapCmd) SetVal(val map[string]struct{})
- func (cmd *StringStructMapCmd) String() string
- func (cmd *StringStructMapCmd) Val() map[string]struct{}
- type Subscription
- type TimeCmd
- func (cmd *TimeCmd) Args() []interface{}
- func (cmd *TimeCmd) Err() error
- func (cmd *TimeCmd) FullName() string
- func (cmd *TimeCmd) Name() string
- func (cmd *TimeCmd) Result() (time.Time, error)
- func (cmd *TimeCmd) SetErr(e error)
- func (cmd *TimeCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *TimeCmd) SetVal(val time.Time)
- func (cmd *TimeCmd) String() string
- func (cmd *TimeCmd) Val() time.Time
- type Tx
- func (hs *Tx) AddHook(hook Hook)
- func (c Tx) Append(ctx context.Context, key, value string) *IntCmd
- func (c Tx) Auth(ctx context.Context, password string) *StatusCmd
- func (c Tx) AuthACL(ctx context.Context, username, password string) *StatusCmd
- func (c Tx) BLMove(ctx context.Context, source, destination, srcpos, destpos string, ...) *StringCmd
- func (c Tx) BLPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func (c Tx) BRPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func (c Tx) BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) *StringCmd
- func (c Tx) BZPopMax(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd
- func (c Tx) BZPopMin(ctx context.Context, timeout time.Duration, keys ...string) *ZWithKeyCmd
- func (c Tx) BgRewriteAOF(ctx context.Context) *StatusCmd
- func (c Tx) BgSave(ctx context.Context) *StatusCmd
- func (c Tx) BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd
- func (c Tx) BitField(ctx context.Context, key string, args ...interface{}) *IntSliceCmd
- func (c Tx) BitOpAnd(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Tx) BitOpNot(ctx context.Context, destKey string, key string) *IntCmd
- func (c Tx) BitOpOr(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Tx) BitOpXor(ctx context.Context, destKey string, keys ...string) *IntCmd
- func (c Tx) BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd
- func (c Tx) ClientGetName(ctx context.Context) *StringCmd
- func (c Tx) ClientID(ctx context.Context) *IntCmd
- func (c Tx) ClientKill(ctx context.Context, ipPort string) *StatusCmd
- func (c Tx) ClientKillByFilter(ctx context.Context, keys ...string) *IntCmd
- func (c Tx) ClientList(ctx context.Context) *StringCmd
- func (c Tx) ClientPause(ctx context.Context, dur time.Duration) *BoolCmd
- func (c Tx) ClientSetName(ctx context.Context, name string) *BoolCmd
- func (c Tx) ClientUnblock(ctx context.Context, id int64) *IntCmd
- func (c Tx) ClientUnblockWithError(ctx context.Context, id int64) *IntCmd
- func (c *Tx) Close(ctx context.Context) error
- func (c Tx) ClusterAddSlots(ctx context.Context, slots ...int) *StatusCmd
- func (c Tx) ClusterAddSlotsRange(ctx context.Context, min, max int) *StatusCmd
- func (c Tx) ClusterCountFailureReports(ctx context.Context, nodeID string) *IntCmd
- func (c Tx) ClusterCountKeysInSlot(ctx context.Context, slot int) *IntCmd
- func (c Tx) ClusterDelSlots(ctx context.Context, slots ...int) *StatusCmd
- func (c Tx) ClusterDelSlotsRange(ctx context.Context, min, max int) *StatusCmd
- func (c Tx) ClusterFailover(ctx context.Context) *StatusCmd
- func (c Tx) ClusterForget(ctx context.Context, nodeID string) *StatusCmd
- func (c Tx) ClusterGetKeysInSlot(ctx context.Context, slot int, count int) *StringSliceCmd
- func (c Tx) ClusterInfo(ctx context.Context) *StringCmd
- func (c Tx) ClusterKeySlot(ctx context.Context, key string) *IntCmd
- func (c Tx) ClusterMeet(ctx context.Context, host, port string) *StatusCmd
- func (c Tx) ClusterNodes(ctx context.Context) *StringCmd
- func (c Tx) ClusterReplicate(ctx context.Context, nodeID string) *StatusCmd
- func (c Tx) ClusterResetHard(ctx context.Context) *StatusCmd
- func (c Tx) ClusterResetSoft(ctx context.Context) *StatusCmd
- func (c Tx) ClusterSaveConfig(ctx context.Context) *StatusCmd
- func (c Tx) ClusterSlaves(ctx context.Context, nodeID string) *StringSliceCmd
- func (c Tx) ClusterSlots(ctx context.Context) *ClusterSlotsCmd
- func (c Tx) Command(ctx context.Context) *CommandsInfoCmd
- func (c Tx) ConfigGet(ctx context.Context, parameter string) *SliceCmd
- func (c Tx) ConfigResetStat(ctx context.Context) *StatusCmd
- func (c Tx) ConfigRewrite(ctx context.Context) *StatusCmd
- func (c Tx) ConfigSet(ctx context.Context, parameter, value string) *StatusCmd
- func (c *Tx) Context() context.Context
- func (c Tx) Copy(ctx context.Context, sourceKey, destKey string, db int, replace bool) *IntCmd
- func (c Tx) DBSize(ctx context.Context) *IntCmd
- func (c Tx) DebugObject(ctx context.Context, key string) *StringCmd
- func (c Tx) Decr(ctx context.Context, key string) *IntCmd
- func (c Tx) DecrBy(ctx context.Context, key string, decrement int64) *IntCmd
- func (c Tx) Del(ctx context.Context, keys ...string) *IntCmd
- func (c Tx) Dump(ctx context.Context, key string) *StringCmd
- func (c Tx) Echo(ctx context.Context, message interface{}) *StringCmd
- func (c Tx) Eval(ctx context.Context, script string, keys []string, args ...interface{}) *Cmd
- func (c Tx) EvalSha(ctx context.Context, sha1 string, keys []string, args ...interface{}) *Cmd
- func (c Tx) Exists(ctx context.Context, keys ...string) *IntCmd
- func (c Tx) Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Tx) ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c Tx) ExpireGT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Tx) ExpireLT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Tx) ExpireNX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Tx) ExpireXX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Tx) FlushAll(ctx context.Context) *StatusCmd
- func (c Tx) FlushAllAsync(ctx context.Context) *StatusCmd
- func (c Tx) FlushDB(ctx context.Context) *StatusCmd
- func (c Tx) FlushDBAsync(ctx context.Context) *StatusCmd
- func (c Tx) GeoAdd(ctx context.Context, key string, geoLocation ...*GeoLocation) *IntCmd
- func (c Tx) GeoDist(ctx context.Context, key string, member1, member2, unit string) *FloatCmd
- func (c Tx) GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd
- func (c Tx) GeoPos(ctx context.Context, key string, members ...string) *GeoPosCmd
- func (c Tx) GeoRadius(ctx context.Context, key string, longitude, latitude float64, ...) *GeoLocationCmd
- func (c Tx) GeoRadiusByMember(ctx context.Context, key, member string, query *GeoRadiusQuery) *GeoLocationCmd
- func (c Tx) GeoRadiusByMemberStore(ctx context.Context, key, member string, query *GeoRadiusQuery) *IntCmd
- func (c Tx) GeoRadiusStore(ctx context.Context, key string, longitude, latitude float64, ...) *IntCmd
- func (c Tx) GeoSearch(ctx context.Context, key string, q *GeoSearchQuery) *StringSliceCmd
- func (c Tx) GeoSearchLocation(ctx context.Context, key string, q *GeoSearchLocationQuery) *GeoSearchLocationCmd
- func (c Tx) GeoSearchStore(ctx context.Context, key, store string, q *GeoSearchStoreQuery) *IntCmd
- func (c Tx) Get(ctx context.Context, key string) *StringCmd
- func (c Tx) GetBit(ctx context.Context, key string, offset int64) *IntCmd
- func (c Tx) GetDel(ctx context.Context, key string) *StringCmd
- func (c Tx) GetEx(ctx context.Context, key string, expiration time.Duration) *StringCmd
- func (c Tx) GetRange(ctx context.Context, key string, start, end int64) *StringCmd
- func (c Tx) GetSet(ctx context.Context, key string, value interface{}) *StringCmd
- func (c Tx) HDel(ctx context.Context, key string, fields ...string) *IntCmd
- func (c Tx) HExists(ctx context.Context, key, field string) *BoolCmd
- func (c Tx) HGet(ctx context.Context, key, field string) *StringCmd
- func (c Tx) HGetAll(ctx context.Context, key string) *StringStringMapCmd
- func (c Tx) HIncrBy(ctx context.Context, key, field string, incr int64) *IntCmd
- func (c Tx) HIncrByFloat(ctx context.Context, key, field string, incr float64) *FloatCmd
- func (c Tx) HKeys(ctx context.Context, key string) *StringSliceCmd
- func (c Tx) HLen(ctx context.Context, key string) *IntCmd
- func (c Tx) HMGet(ctx context.Context, key string, fields ...string) *SliceCmd
- func (c Tx) HMSet(ctx context.Context, key string, values ...interface{}) *BoolCmd
- func (c Tx) HRandField(ctx context.Context, key string, count int, withValues bool) *StringSliceCmd
- func (c Tx) HScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Tx) HSet(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Tx) HSetNX(ctx context.Context, key, field string, value interface{}) *BoolCmd
- func (c Tx) HVals(ctx context.Context, key string) *StringSliceCmd
- func (c Tx) Incr(ctx context.Context, key string) *IntCmd
- func (c Tx) IncrBy(ctx context.Context, key string, value int64) *IntCmd
- func (c Tx) IncrByFloat(ctx context.Context, key string, value float64) *FloatCmd
- func (c Tx) Info(ctx context.Context, section ...string) *StringCmd
- func (c Tx) Keys(ctx context.Context, pattern string) *StringSliceCmd
- func (c Tx) LIndex(ctx context.Context, key string, index int64) *StringCmd
- func (c Tx) LInsert(ctx context.Context, key, op string, pivot, value interface{}) *IntCmd
- func (c Tx) LInsertAfter(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func (c Tx) LInsertBefore(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func (c Tx) LLen(ctx context.Context, key string) *IntCmd
- func (c Tx) LMove(ctx context.Context, source, destination, srcpos, destpos string) *StringCmd
- func (c Tx) LPop(ctx context.Context, key string) *StringCmd
- func (c Tx) LPopCount(ctx context.Context, key string, count int) *StringSliceCmd
- func (c Tx) LPos(ctx context.Context, key string, value string, a LPosArgs) *IntCmd
- func (c Tx) LPosCount(ctx context.Context, key string, value string, count int64, a LPosArgs) *IntSliceCmd
- func (c Tx) LPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Tx) LPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Tx) LRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Tx) LRem(ctx context.Context, key string, count int64, value interface{}) *IntCmd
- func (c Tx) LSet(ctx context.Context, key string, index int64, value interface{}) *StatusCmd
- func (c Tx) LTrim(ctx context.Context, key string, start, stop int64) *StatusCmd
- func (c Tx) LastSave(ctx context.Context) *IntCmd
- func (c Tx) MGet(ctx context.Context, keys ...string) *SliceCmd
- func (c Tx) MSet(ctx context.Context, values ...interface{}) *StatusCmd
- func (c Tx) MSetNX(ctx context.Context, values ...interface{}) *BoolCmd
- func (c Tx) MemoryUsage(ctx context.Context, key string, samples ...int) *IntCmd
- func (c Tx) Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd
- func (c Tx) Move(ctx context.Context, key string, db int) *BoolCmd
- func (c Tx) ObjectEncoding(ctx context.Context, key string) *StringCmd
- func (c Tx) ObjectIdleTime(ctx context.Context, key string) *DurationCmd
- func (c Tx) ObjectRefCount(ctx context.Context, key string) *IntCmd
- func (c Tx) PExpire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c Tx) PExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c Tx) PFAdd(ctx context.Context, key string, els ...interface{}) *IntCmd
- func (c Tx) PFCount(ctx context.Context, keys ...string) *IntCmd
- func (c Tx) PFMerge(ctx context.Context, dest string, keys ...string) *StatusCmd
- func (c Tx) PTTL(ctx context.Context, key string) *DurationCmd
- func (c Tx) Persist(ctx context.Context, key string) *BoolCmd
- func (c Tx) Ping(ctx context.Context) *StatusCmd
- func (c *Tx) Pipeline() Pipeliner
- func (c *Tx) Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- func (c *Tx) Process(ctx context.Context, cmd Cmder) error
- func (c Tx) PubSubChannels(ctx context.Context, pattern string) *StringSliceCmd
- func (c Tx) PubSubNumPat(ctx context.Context) *IntCmd
- func (c Tx) PubSubNumSub(ctx context.Context, channels ...string) *StringIntMapCmd
- func (c Tx) Publish(ctx context.Context, channel string, message interface{}) *IntCmd
- func (c Tx) Quit(_ context.Context) *StatusCmd
- func (c Tx) RPop(ctx context.Context, key string) *StringCmd
- func (c Tx) RPopCount(ctx context.Context, key string, count int) *StringSliceCmd
- func (c Tx) RPopLPush(ctx context.Context, source, destination string) *StringCmd
- func (c Tx) RPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Tx) RPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c Tx) RandomKey(ctx context.Context) *StringCmd
- func (c Tx) ReadOnly(ctx context.Context) *StatusCmd
- func (c Tx) ReadWrite(ctx context.Context) *StatusCmd
- func (c Tx) Rename(ctx context.Context, key, newkey string) *StatusCmd
- func (c Tx) RenameNX(ctx context.Context, key, newkey string) *BoolCmd
- func (c Tx) Restore(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd
- func (c Tx) RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) *StatusCmd
- func (c Tx) SAdd(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Tx) SCard(ctx context.Context, key string) *IntCmd
- func (c Tx) SDiff(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Tx) SDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Tx) SInter(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Tx) SInterStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Tx) SIsMember(ctx context.Context, key string, member interface{}) *BoolCmd
- func (c Tx) SMIsMember(ctx context.Context, key string, members ...interface{}) *BoolSliceCmd
- func (c Tx) SMembers(ctx context.Context, key string) *StringSliceCmd
- func (c Tx) SMembersMap(ctx context.Context, key string) *StringStructMapCmd
- func (c Tx) SMove(ctx context.Context, source, destination string, member interface{}) *BoolCmd
- func (c Tx) SPop(ctx context.Context, key string) *StringCmd
- func (c Tx) SPopN(ctx context.Context, key string, count int64) *StringSliceCmd
- func (c Tx) SRandMember(ctx context.Context, key string) *StringCmd
- func (c Tx) SRandMemberN(ctx context.Context, key string, count int64) *StringSliceCmd
- func (c Tx) SRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Tx) SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Tx) SUnion(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Tx) SUnionStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Tx) Save(ctx context.Context) *StatusCmd
- func (c Tx) Scan(ctx context.Context, cursor uint64, match string, count int64) *ScanCmd
- func (c Tx) ScanType(ctx context.Context, cursor uint64, match string, count int64, keyType string) *ScanCmd
- func (c Tx) ScriptExists(ctx context.Context, hashes ...string) *BoolSliceCmd
- func (c Tx) ScriptFlush(ctx context.Context) *StatusCmd
- func (c Tx) ScriptKill(ctx context.Context) *StatusCmd
- func (c Tx) ScriptLoad(ctx context.Context, script string) *StringCmd
- func (c Tx) Select(ctx context.Context, index int) *StatusCmd
- func (c Tx) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- func (c Tx) SetArgs(ctx context.Context, key string, value interface{}, a SetArgs) *StatusCmd
- func (c Tx) SetBit(ctx context.Context, key string, offset int64, value int) *IntCmd
- func (c Tx) SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- func (c Tx) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func (c Tx) SetRange(ctx context.Context, key string, offset int64, value string) *IntCmd
- func (c Tx) SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func (c Tx) Shutdown(ctx context.Context) *StatusCmd
- func (c Tx) ShutdownNoSave(ctx context.Context) *StatusCmd
- func (c Tx) ShutdownSave(ctx context.Context) *StatusCmd
- func (c Tx) SlaveOf(ctx context.Context, host, port string) *StatusCmd
- func (c Tx) SlowLogGet(ctx context.Context, num int64) *SlowLogCmd
- func (c Tx) Sort(ctx context.Context, key string, sort *Sort) *StringSliceCmd
- func (c Tx) SortInterfaces(ctx context.Context, key string, sort *Sort) *SliceCmd
- func (c Tx) SortStore(ctx context.Context, key, store string, sort *Sort) *IntCmd
- func (c Tx) StrLen(ctx context.Context, key string) *IntCmd
- func (c *Tx) String() string
- func (c Tx) SwapDB(ctx context.Context, index1, index2 int) *StatusCmd
- func (c Tx) Sync(_ context.Context)
- func (c Tx) TTL(ctx context.Context, key string) *DurationCmd
- func (c Tx) Time(ctx context.Context) *TimeCmd
- func (c Tx) Touch(ctx context.Context, keys ...string) *IntCmd
- func (c *Tx) TxPipeline() Pipeliner
- func (c *Tx) TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
- func (c Tx) Type(ctx context.Context, key string) *StatusCmd
- func (c Tx) Unlink(ctx context.Context, keys ...string) *IntCmd
- func (c *Tx) Unwatch(ctx context.Context, keys ...string) *StatusCmd
- func (c Tx) Wait(ctx context.Context, numSlaves int, timeout time.Duration) *IntCmd
- func (c *Tx) Watch(ctx context.Context, keys ...string) *StatusCmd
- func (c *Tx) WithContext(ctx context.Context) *Tx
- func (c Tx) XAck(ctx context.Context, stream, group string, ids ...string) *IntCmd
- func (c Tx) XAdd(ctx context.Context, a *XAddArgs) *StringCmd
- func (c Tx) XAutoClaim(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimCmd
- func (c Tx) XAutoClaimJustID(ctx context.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd
- func (c Tx) XClaim(ctx context.Context, a *XClaimArgs) *XMessageSliceCmd
- func (c Tx) XClaimJustID(ctx context.Context, a *XClaimArgs) *StringSliceCmd
- func (c Tx) XDel(ctx context.Context, stream string, ids ...string) *IntCmd
- func (c Tx) XGroupCreate(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Tx) XGroupCreateConsumer(ctx context.Context, stream, group, consumer string) *IntCmd
- func (c Tx) XGroupCreateMkStream(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Tx) XGroupDelConsumer(ctx context.Context, stream, group, consumer string) *IntCmd
- func (c Tx) XGroupDestroy(ctx context.Context, stream, group string) *IntCmd
- func (c Tx) XGroupSetID(ctx context.Context, stream, group, start string) *StatusCmd
- func (c Tx) XInfoConsumers(ctx context.Context, key string, group string) *XInfoConsumersCmd
- func (c Tx) XInfoGroups(ctx context.Context, key string) *XInfoGroupsCmd
- func (c Tx) XInfoStream(ctx context.Context, key string) *XInfoStreamCmd
- func (c Tx) XInfoStreamFull(ctx context.Context, key string, count int) *XInfoStreamFullCmd
- func (c Tx) XLen(ctx context.Context, stream string) *IntCmd
- func (c Tx) XPending(ctx context.Context, stream, group string) *XPendingCmd
- func (c Tx) XPendingExt(ctx context.Context, a *XPendingExtArgs) *XPendingExtCmd
- func (c Tx) XRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd
- func (c Tx) XRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd
- func (c Tx) XRead(ctx context.Context, a *XReadArgs) *XStreamSliceCmd
- func (c Tx) XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSliceCmd
- func (c Tx) XReadStreams(ctx context.Context, streams ...string) *XStreamSliceCmd
- func (c Tx) XRevRange(ctx context.Context, stream, start, stop string) *XMessageSliceCmd
- func (c Tx) XRevRangeN(ctx context.Context, stream, start, stop string, count int64) *XMessageSliceCmd
- func (c Tx) XTrim(ctx context.Context, key string, maxLen int64) *IntCmddeprecated
- func (c Tx) XTrimApprox(ctx context.Context, key string, maxLen int64) *IntCmddeprecated
- func (c Tx) XTrimMaxLen(ctx context.Context, key string, maxLen int64) *IntCmd
- func (c Tx) XTrimMaxLenApprox(ctx context.Context, key string, maxLen, limit int64) *IntCmd
- func (c Tx) XTrimMinID(ctx context.Context, key string, minID string) *IntCmd
- func (c Tx) XTrimMinIDApprox(ctx context.Context, key string, minID string, limit int64) *IntCmd
- func (c Tx) ZAdd(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Tx) ZAddArgs(ctx context.Context, key string, args ZAddArgs) *IntCmd
- func (c Tx) ZAddArgsIncr(ctx context.Context, key string, args ZAddArgs) *FloatCmd
- func (c Tx) ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Tx) ZAddNX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Tx) ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Tx) ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Tx) ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c Tx) ZCard(ctx context.Context, key string) *IntCmd
- func (c Tx) ZCount(ctx context.Context, key, min, max string) *IntCmd
- func (c Tx) ZDiff(ctx context.Context, keys ...string) *StringSliceCmd
- func (c Tx) ZDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func (c Tx) ZDiffWithScores(ctx context.Context, keys ...string) *ZSliceCmd
- func (c Tx) ZIncr(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Tx) ZIncrBy(ctx context.Context, key string, increment float64, member string) *FloatCmd
- func (c Tx) ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Tx) ZIncrXX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c Tx) ZInter(ctx context.Context, store *ZStore) *StringSliceCmd
- func (c Tx) ZInterStore(ctx context.Context, destination string, store *ZStore) *IntCmd
- func (c Tx) ZInterWithScores(ctx context.Context, store *ZStore) *ZSliceCmd
- func (c Tx) ZLexCount(ctx context.Context, key, min, max string) *IntCmd
- func (c Tx) ZMScore(ctx context.Context, key string, members ...string) *FloatSliceCmd
- func (c Tx) ZPopMax(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func (c Tx) ZPopMin(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func (c Tx) ZRandMember(ctx context.Context, key string, count int, withScores bool) *StringSliceCmd
- func (c Tx) ZRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Tx) ZRangeArgs(ctx context.Context, z ZRangeArgs) *StringSliceCmd
- func (c Tx) ZRangeArgsWithScores(ctx context.Context, z ZRangeArgs) *ZSliceCmd
- func (c Tx) ZRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Tx) ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Tx) ZRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c Tx) ZRangeStore(ctx context.Context, dst string, z ZRangeArgs) *IntCmd
- func (c Tx) ZRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c Tx) ZRank(ctx context.Context, key, member string) *IntCmd
- func (c Tx) ZRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c Tx) ZRemRangeByLex(ctx context.Context, key, min, max string) *IntCmd
- func (c Tx) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) *IntCmd
- func (c Tx) ZRemRangeByScore(ctx context.Context, key, min, max string) *IntCmd
- func (c Tx) ZRevRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func (c Tx) ZRevRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Tx) ZRevRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func (c Tx) ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c Tx) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c Tx) ZRevRank(ctx context.Context, key, member string) *IntCmd
- func (c Tx) ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func (c Tx) ZScore(ctx context.Context, key, member string) *FloatCmd
- func (c Tx) ZUnion(ctx context.Context, store ZStore) *StringSliceCmd
- func (c Tx) ZUnionStore(ctx context.Context, dest string, store *ZStore) *IntCmd
- func (c Tx) ZUnionWithScores(ctx context.Context, store ZStore) *ZSliceCmd
- type UniversalClient
- type UniversalOptions
- type XAddArgs
- type XAutoClaimArgs
- type XAutoClaimCmd
- func (cmd *XAutoClaimCmd) Args() []interface{}
- func (cmd *XAutoClaimCmd) Err() error
- func (cmd *XAutoClaimCmd) FullName() string
- func (cmd *XAutoClaimCmd) Name() string
- func (cmd *XAutoClaimCmd) Result() (messages []XMessage, start string, err error)
- func (cmd *XAutoClaimCmd) SetErr(e error)
- func (cmd *XAutoClaimCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *XAutoClaimCmd) SetVal(val []XMessage, start string)
- func (cmd *XAutoClaimCmd) String() string
- func (cmd *XAutoClaimCmd) Val() (messages []XMessage, start string)
- type XAutoClaimJustIDCmd
- func (cmd *XAutoClaimJustIDCmd) Args() []interface{}
- func (cmd *XAutoClaimJustIDCmd) Err() error
- func (cmd *XAutoClaimJustIDCmd) FullName() string
- func (cmd *XAutoClaimJustIDCmd) Name() string
- func (cmd *XAutoClaimJustIDCmd) Result() (ids []string, start string, err error)
- func (cmd *XAutoClaimJustIDCmd) SetErr(e error)
- func (cmd *XAutoClaimJustIDCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *XAutoClaimJustIDCmd) SetVal(val []string, start string)
- func (cmd *XAutoClaimJustIDCmd) String() string
- func (cmd *XAutoClaimJustIDCmd) Val() (ids []string, start string)
- type XClaimArgs
- type XInfoConsumer
- type XInfoConsumersCmd
- func (cmd *XInfoConsumersCmd) Args() []interface{}
- func (cmd *XInfoConsumersCmd) Err() error
- func (cmd *XInfoConsumersCmd) FullName() string
- func (cmd *XInfoConsumersCmd) Name() string
- func (cmd *XInfoConsumersCmd) Result() ([]XInfoConsumer, error)
- func (cmd *XInfoConsumersCmd) SetErr(e error)
- func (cmd *XInfoConsumersCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *XInfoConsumersCmd) SetVal(val []XInfoConsumer)
- func (cmd *XInfoConsumersCmd) String() string
- func (cmd *XInfoConsumersCmd) Val() []XInfoConsumer
- type XInfoGroup
- type XInfoGroupsCmd
- func (cmd *XInfoGroupsCmd) Args() []interface{}
- func (cmd *XInfoGroupsCmd) Err() error
- func (cmd *XInfoGroupsCmd) FullName() string
- func (cmd *XInfoGroupsCmd) Name() string
- func (cmd *XInfoGroupsCmd) Result() ([]XInfoGroup, error)
- func (cmd *XInfoGroupsCmd) SetErr(e error)
- func (cmd *XInfoGroupsCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *XInfoGroupsCmd) SetVal(val []XInfoGroup)
- func (cmd *XInfoGroupsCmd) String() string
- func (cmd *XInfoGroupsCmd) Val() []XInfoGroup
- type XInfoStream
- type XInfoStreamCmd
- func (cmd *XInfoStreamCmd) Args() []interface{}
- func (cmd *XInfoStreamCmd) Err() error
- func (cmd *XInfoStreamCmd) FullName() string
- func (cmd *XInfoStreamCmd) Name() string
- func (cmd *XInfoStreamCmd) Result() (*XInfoStream, error)
- func (cmd *XInfoStreamCmd) SetErr(e error)
- func (cmd *XInfoStreamCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *XInfoStreamCmd) SetVal(val *XInfoStream)
- func (cmd *XInfoStreamCmd) String() string
- func (cmd *XInfoStreamCmd) Val() *XInfoStream
- type XInfoStreamConsumer
- type XInfoStreamConsumerPending
- type XInfoStreamFull
- type XInfoStreamFullCmd
- func (cmd *XInfoStreamFullCmd) Args() []interface{}
- func (cmd *XInfoStreamFullCmd) Err() error
- func (cmd *XInfoStreamFullCmd) FullName() string
- func (cmd *XInfoStreamFullCmd) Name() string
- func (cmd *XInfoStreamFullCmd) Result() (*XInfoStreamFull, error)
- func (cmd *XInfoStreamFullCmd) SetErr(e error)
- func (cmd *XInfoStreamFullCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *XInfoStreamFullCmd) SetVal(val *XInfoStreamFull)
- func (cmd *XInfoStreamFullCmd) String() string
- func (cmd *XInfoStreamFullCmd) Val() *XInfoStreamFull
- type XInfoStreamGroup
- type XInfoStreamGroupPending
- type XMessage
- type XMessageSliceCmd
- func (cmd *XMessageSliceCmd) Args() []interface{}
- func (cmd *XMessageSliceCmd) Err() error
- func (cmd *XMessageSliceCmd) FullName() string
- func (cmd *XMessageSliceCmd) Name() string
- func (cmd *XMessageSliceCmd) Result() ([]XMessage, error)
- func (cmd *XMessageSliceCmd) SetErr(e error)
- func (cmd *XMessageSliceCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *XMessageSliceCmd) SetVal(val []XMessage)
- func (cmd *XMessageSliceCmd) String() string
- func (cmd *XMessageSliceCmd) Val() []XMessage
- type XPending
- type XPendingCmd
- func (cmd *XPendingCmd) Args() []interface{}
- func (cmd *XPendingCmd) Err() error
- func (cmd *XPendingCmd) FullName() string
- func (cmd *XPendingCmd) Name() string
- func (cmd *XPendingCmd) Result() (*XPending, error)
- func (cmd *XPendingCmd) SetErr(e error)
- func (cmd *XPendingCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *XPendingCmd) SetVal(val *XPending)
- func (cmd *XPendingCmd) String() string
- func (cmd *XPendingCmd) Val() *XPending
- type XPendingExt
- type XPendingExtArgs
- type XPendingExtCmd
- func (cmd *XPendingExtCmd) Args() []interface{}
- func (cmd *XPendingExtCmd) Err() error
- func (cmd *XPendingExtCmd) FullName() string
- func (cmd *XPendingExtCmd) Name() string
- func (cmd *XPendingExtCmd) Result() ([]XPendingExt, error)
- func (cmd *XPendingExtCmd) SetErr(e error)
- func (cmd *XPendingExtCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *XPendingExtCmd) SetVal(val []XPendingExt)
- func (cmd *XPendingExtCmd) String() string
- func (cmd *XPendingExtCmd) Val() []XPendingExt
- type XReadArgs
- type XReadGroupArgs
- type XStream
- type XStreamSliceCmd
- func (cmd *XStreamSliceCmd) Args() []interface{}
- func (cmd *XStreamSliceCmd) Err() error
- func (cmd *XStreamSliceCmd) FullName() string
- func (cmd *XStreamSliceCmd) Name() string
- func (cmd *XStreamSliceCmd) Result() ([]XStream, error)
- func (cmd *XStreamSliceCmd) SetErr(e error)
- func (cmd *XStreamSliceCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *XStreamSliceCmd) SetVal(val []XStream)
- func (cmd *XStreamSliceCmd) String() string
- func (cmd *XStreamSliceCmd) Val() []XStream
- type Z
- type ZAddArgs
- type ZRangeArgs
- type ZRangeBy
- type ZSliceCmd
- func (cmd *ZSliceCmd) Args() []interface{}
- func (cmd *ZSliceCmd) Err() error
- func (cmd *ZSliceCmd) FullName() string
- func (cmd *ZSliceCmd) Name() string
- func (cmd *ZSliceCmd) Result() ([]Z, error)
- func (cmd *ZSliceCmd) SetErr(e error)
- func (cmd *ZSliceCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *ZSliceCmd) SetVal(val []Z)
- func (cmd *ZSliceCmd) String() string
- func (cmd *ZSliceCmd) Val() []Z
- type ZStore
- type ZWithKey
- type ZWithKeyCmd
- func (cmd *ZWithKeyCmd) Args() []interface{}
- func (cmd *ZWithKeyCmd) Err() error
- func (cmd *ZWithKeyCmd) FullName() string
- func (cmd *ZWithKeyCmd) Name() string
- func (cmd *ZWithKeyCmd) Result() (*ZWithKey, error)
- func (cmd *ZWithKeyCmd) SetErr(e error)
- func (cmd *ZWithKeyCmd) SetFirstKeyPos(keyPos int8)
- func (cmd *ZWithKeyCmd) SetVal(val *ZWithKey)
- func (cmd *ZWithKeyCmd) String() string
- func (cmd *ZWithKeyCmd) Val() *ZWithKey
Examples¶
- Package (CustomCommand)
- Package (CustomCommand2)
- Package (Instrumentation)
- Client
- Client.BLPop
- Client.Incr
- Client.Pipeline
- Client.Pipelined
- Client.Scan
- Client.ScanType
- Client.Set
- Client.SetEX
- Client.SlowLogGet
- Client.TxPipeline
- Client.TxPipelined
- Client.Watch
- Client.Watch (Instrumentation)
- Conn
- NewClient
- NewClusterClient
- NewClusterClient (ManualSetup)
- NewFailoverClient
- NewRing
- NewUniversalClient (Cluster)
- NewUniversalClient (Failover)
- NewUniversalClient (Simple)
- ParseURL
- Pipeline (Instrumentation)
- PubSub
- PubSub.Receive
- ScanCmd.Iterator
- ScanIterator
- Script
- SliceCmd.Scan
- StringStringMapCmd.Scan
Constants¶
const KeepTTL = -1KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.For example:
rdb.Set(ctx, key, value, redis.KeepTTL)
const Nil =proto.NilNil reply returned by Redis when key does not exist.
const TxFailedErr =proto.RedisError("redis: transaction failed")TxFailedErr transaction redis failed.
Variables¶
var ErrClosed =pool.ErrClosedErrClosed performs any operation on the closed client will return this error.
Functions¶
Types¶
typeBoolCmd¶
type BoolCmd struct {// contains filtered or unexported fields}funcNewBoolCmd¶
funcNewBoolResult¶
NewBoolResult returns a BoolCmd initialised with val and err for testing.
func (*BoolCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *BoolCmd) SetFirstKeyPos(keyPosint8)
typeBoolSliceCmd¶
type BoolSliceCmd struct {// contains filtered or unexported fields}funcNewBoolSliceCmd¶
func NewBoolSliceCmd(ctxcontext.Context, args ...interface{}) *BoolSliceCmd
funcNewBoolSliceResult¶
func NewBoolSliceResult(val []bool, errerror) *BoolSliceCmd
NewBoolSliceResult returns a BoolSliceCmd initialised with val and err for testing.
func (*BoolSliceCmd)Result¶
func (cmd *BoolSliceCmd) Result() ([]bool,error)
func (*BoolSliceCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *BoolSliceCmd) SetFirstKeyPos(keyPosint8)
func (*BoolSliceCmd)SetVal¶added inv8.11.4
func (cmd *BoolSliceCmd) SetVal(val []bool)
func (*BoolSliceCmd)String¶
func (cmd *BoolSliceCmd) String()string
func (*BoolSliceCmd)Val¶
func (cmd *BoolSliceCmd) Val() []bool
typeChannelOption¶added inv8.9.0
type ChannelOption func(c *channel)
funcWithChannelHealthCheckInterval¶added inv8.9.0
func WithChannelHealthCheckInterval(dtime.Duration)ChannelOption
WithChannelHealthCheckInterval specifies the health check interval.PubSub will ping Redis Server if it does not receive any messages within the interval.To disable health check, use zero interval.
The default is 3 seconds.
funcWithChannelSendTimeout¶added inv8.9.0
func WithChannelSendTimeout(dtime.Duration)ChannelOption
WithChannelSendTimeout specifies the channel send timeout after whichthe message is dropped.
The default is 60 seconds.
funcWithChannelSize¶added inv8.9.0
func WithChannelSize(sizeint)ChannelOption
WithChannelSize specifies the Go chan size that is used to buffer incoming messages.
The default is 100 messages.
typeClient¶
type Client struct {// contains filtered or unexported fields}Client is a Redis client representing a pool of zero or moreunderlying connections. It's safe for concurrent use by multiplegoroutines.
Example¶
err := rdb.Set(ctx, "key", "value", 0).Err()if err != nil {panic(err)}val, err := rdb.Get(ctx, "key").Result()if err != nil {panic(err)}fmt.Println("key", val)val2, err := rdb.Get(ctx, "missing_key").Result()if err == redis.Nil {fmt.Println("missing_key does not exist")} else if err != nil {panic(err)} else {fmt.Println("missing_key", val2)}Output:key valuemissing_key does not exist
funcNewClient¶
NewClient returns a client to the Redis Server specified by Options.
Example¶
rdb := redis.NewClient(&redis.Options{Addr: "localhost:6379", // use default AddrPassword: "", // no password setDB: 0, // use default DB})pong, err := rdb.Ping(ctx).Result()fmt.Println(pong, err)Output:PONG <nil>
funcNewFailoverClient¶
func NewFailoverClient(failoverOpt *FailoverOptions) *Client
NewFailoverClient returns a Redis client that uses Redis Sentinelfor automatic failover. It's safe for concurrent use by multiplegoroutines.
Example¶
// See http://redis.io/topics/sentinel for instructions how to// setup Redis Sentinel.rdb := redis.NewFailoverClient(&redis.FailoverOptions{MasterName: "master",SentinelAddrs: []string{":26379"},})rdb.Ping(ctx)func (Client)BLPop¶
Example¶
if err := rdb.RPush(ctx, "queue", "message").Err(); err != nil {panic(err)}// use `rdb.BLPop(0, "queue")` for infinite waiting timeresult, err := rdb.BLPop(ctx, 1*time.Second, "queue").Result()if err != nil {panic(err)}fmt.Println(result[0], result[1])Output:queue message
func (Client)BRPopLPush¶
func (Client)BgRewriteAOF¶
func (Client)BitField¶
func (c Client) BitField(ctxcontext.Context, keystring, args ...interface{}) *IntSliceCmd
func (Client)ClientGetName¶
ClientGetName returns the name of the connection.
func (Client)ClientKillByFilter¶
ClientKillByFilter is new style syntax, while the ClientKill is old
CLIENT KILL <option> [value] ... <option> [value]
func (Client)ClientList¶
func (Client)ClientUnblockWithError¶
func (Client)Close¶
func (c Client) Close()error
Close closes the client, releasing any open resources.
It is rare to Close a Client, as the Client is meant to belong-lived and shared between many goroutines.
func (Client)ClusterAddSlots¶
func (Client)ClusterAddSlotsRange¶
func (Client)ClusterCountFailureReports¶
func (Client)ClusterCountKeysInSlot¶
func (Client)ClusterDelSlots¶
func (Client)ClusterDelSlotsRange¶
func (Client)ClusterFailover¶
func (Client)ClusterForget¶
func (Client)ClusterGetKeysInSlot¶
func (c Client) ClusterGetKeysInSlot(ctxcontext.Context, slotint, countint) *StringSliceCmd
func (Client)ClusterInfo¶
func (Client)ClusterMeet¶
func (Client)ClusterNodes¶
func (Client)ClusterReplicate¶
func (Client)ClusterResetHard¶
func (Client)ClusterResetSoft¶
func (Client)ClusterSaveConfig¶
func (Client)ClusterSlaves¶
func (c Client) ClusterSlaves(ctxcontext.Context, nodeIDstring) *StringSliceCmd
func (Client)ClusterSlots¶
func (c Client) ClusterSlots(ctxcontext.Context) *ClusterSlotsCmd
func (Client)Command¶
func (c Client) Command(ctxcontext.Context) *CommandsInfoCmd
func (Client)ConfigResetStat¶
func (Client)ConfigRewrite¶
func (Client)FlushAllAsync¶
func (Client)FlushDBAsync¶
func (Client)GeoAdd¶
func (c Client) GeoAdd(ctxcontext.Context, keystring, geoLocation ...*GeoLocation) *IntCmd
func (Client)GeoHash¶
func (c Client) GeoHash(ctxcontext.Context, keystring, members ...string) *StringSliceCmd
func (Client)GeoRadius¶
func (c Client) GeoRadius(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery,) *GeoLocationCmd
GeoRadius is a read-only GEORADIUS_RO command.
func (Client)GeoRadiusByMember¶
func (c Client) GeoRadiusByMember(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery,) *GeoLocationCmd
GeoRadiusByMember is a read-only GEORADIUSBYMEMBER_RO command.
func (Client)GeoRadiusByMemberStore¶
func (c Client) GeoRadiusByMemberStore(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery,) *IntCmd
GeoRadiusByMemberStore is a writing GEORADIUSBYMEMBER command.
func (Client)GeoRadiusStore¶
func (c Client) GeoRadiusStore(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery,) *IntCmd
GeoRadiusStore is a writing GEORADIUS command.
func (Client)GeoSearch¶added inv8.11.1
func (c Client) GeoSearch(ctxcontext.Context, keystring, q *GeoSearchQuery) *StringSliceCmd
func (Client)GeoSearchLocation¶added inv8.11.1
func (c Client) GeoSearchLocation(ctxcontext.Context, keystring, q *GeoSearchLocationQuery,) *GeoSearchLocationCmd
func (Client)GeoSearchStore¶added inv8.11.1
func (c Client) GeoSearchStore(ctxcontext.Context, key, storestring, q *GeoSearchStoreQuery) *IntCmd
func (Client)GetEx¶added inv8.8.1
GetEx An expiration of zero removes the TTL associated with the key (i.e. GETEX key persist).Requires Redis >= 6.2.0.
func (Client)HIncrByFloat¶
func (Client)HMGet¶
HMGet returns the values for the specified fields in the hash stored at key.It returns an interface{} to distinguish between empty string and nil value.
func (Client)HRandField¶added inv8.8.1
HRandField redis-server version >= 6.2.0.
func (Client)HSet¶
HSet accepts values in following formats:
- HSet("myhash", "key1", "value1", "key2", "value2")
- HSet("myhash", []string{"key1", "value1", "key2", "value2"})
- HSet("myhash", map[string]interface{}{"key1": "value1", "key2": "value2"})
Note that it requires Redis v4 for multiple field/value pairs support.
func (Client)Incr¶
Example¶
result, err := rdb.Incr(ctx, "counter").Result()if err != nil {panic(err)}fmt.Println(result)Output:1
func (Client)IncrByFloat¶
func (Client)LInsertAfter¶
func (Client)LInsertBefore¶
func (Client)LPopCount¶added inv8.8.3
func (c Client) LPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmd
func (Client)LRange¶
func (c Client) LRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (Client)MSet¶
MSet is like Set but accepts multiple values:
- MSet("key1", "value1", "key2", "value2")
- MSet([]string{"key1", "value1", "key2", "value2"})
- MSet(map[string]interface{}{"key1": "value1", "key2": "value2"})
func (Client)MSetNX¶
MSetNX is like SetNX but accepts multiple values:
- MSetNX("key1", "value1", "key2", "value2")
- MSetNX([]string{"key1", "value1", "key2", "value2"})
- MSetNX(map[string]interface{}{"key1": "value1", "key2": "value2"})
func (Client)MemoryUsage¶
func (Client)ObjectEncoding¶
func (Client)ObjectIdleTime¶
func (c Client) ObjectIdleTime(ctxcontext.Context, keystring) *DurationCmd
func (*Client)PSubscribe¶
PSubscribe subscribes the client to the given patterns.Patterns can be omitted to create empty subscription.
func (*Client)Pipeline¶
Example¶
pipe := rdb.Pipeline()incr := pipe.Incr(ctx, "pipeline_counter")pipe.Expire(ctx, "pipeline_counter", time.Hour)// Execute//// INCR pipeline_counter// EXPIRE pipeline_counts 3600//// using one rdb-server roundtrip._, err := pipe.Exec(ctx)fmt.Println(incr.Val(), err)
Output:1 <nil>
func (*Client)Pipelined¶
Example¶
var incr *redis.IntCmd_, err := rdb.Pipelined(ctx, func(pipe redis.Pipeliner) error {incr = pipe.Incr(ctx, "pipelined_counter")pipe.Expire(ctx, "pipelined_counter", time.Hour)return nil})fmt.Println(incr.Val(), err)Output:1 <nil>
func (Client)PubSubChannels¶
func (c Client) PubSubChannels(ctxcontext.Context, patternstring) *StringSliceCmd
func (Client)PubSubNumPat¶
func (Client)PubSubNumSub¶
func (c Client) PubSubNumSub(ctxcontext.Context, channels ...string) *StringIntMapCmd
func (Client)RPopCount¶added inv8.11.1
func (c Client) RPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmd
func (Client)RestoreReplace¶
func (Client)SDiffStore¶
func (Client)SInterStore¶
func (Client)SMIsMember¶added inv8.8.3
func (c Client) SMIsMember(ctxcontext.Context, keystring, members ...interface{}) *BoolSliceCmd
SMIsMember Redis `SMISMEMBER key member [member ...]` command.
func (Client)SMembers¶
func (c Client) SMembers(ctxcontext.Context, keystring) *StringSliceCmd
SMembers Redis `SMEMBERS key` command output as a slice.
func (Client)SMembersMap¶
func (c Client) SMembersMap(ctxcontext.Context, keystring) *StringStructMapCmd
SMembersMap Redis `SMEMBERS key` command output as a map.
func (Client)SPopN¶
func (c Client) SPopN(ctxcontext.Context, keystring, countint64) *StringSliceCmd
SPopN Redis `SPOP key count` command.
func (Client)SRandMember¶
SRandMember Redis `SRANDMEMBER key` command.
func (Client)SRandMemberN¶
func (c Client) SRandMemberN(ctxcontext.Context, keystring, countint64) *StringSliceCmd
SRandMemberN Redis `SRANDMEMBER key count` command.
func (Client)SUnionStore¶
func (Client)Scan¶
Example¶
rdb.FlushDB(ctx)for i := 0; i < 33; i++ {err := rdb.Set(ctx, fmt.Sprintf("key%d", i), "value", 0).Err()if err != nil {panic(err)}}var cursor uint64var n intfor {var keys []stringvar err errorkeys, cursor, err = rdb.Scan(ctx, cursor, "key*", 10).Result()if err != nil {panic(err)}n += len(keys)if cursor == 0 {break}}fmt.Printf("found %d keys\n", n)Output:found 33 keys
func (Client)ScanType¶added inv8.4.7
func (c Client) ScanType(ctxcontext.Context, cursoruint64, matchstring, countint64, keyTypestring) *ScanCmd
Example¶
rdb.FlushDB(ctx)for i := 0; i < 33; i++ {err := rdb.Set(ctx, fmt.Sprintf("key%d", i), "value", 0).Err()if err != nil {panic(err)}}var cursor uint64var n intfor {var keys []stringvar err errorkeys, cursor, err = rdb.ScanType(ctx, cursor, "key*", 10, "string").Result()if err != nil {panic(err)}n += len(keys)if cursor == 0 {break}}fmt.Printf("found %d keys\n", n)Output:found 33 keys
func (Client)ScriptExists¶
func (c Client) ScriptExists(ctxcontext.Context, hashes ...string) *BoolSliceCmd
func (Client)ScriptFlush¶
func (Client)ScriptKill¶
func (Client)Set¶
func (c Client) Set(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmd
Set Redis `SET key value [expiration]` command.Use expiration for `SETEX`-like behavior.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
Example¶
// Last argument is expiration. Zero means the key has no// expiration time.err := rdb.Set(ctx, "key", "value", 0).Err()if err != nil {panic(err)}// key2 will expire in an hour.err = rdb.Set(ctx, "key2", "value", time.Hour).Err()if err != nil {panic(err)}func (Client)SetArgs¶added inv8.6.0
SetArgs supports all the options that the SET command supports.It is the alternative to the Set function when you wantto have more control over the options.
func (Client)SetEX¶added inv8.3.3
func (c Client) SetEX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmd
SetEX Redis `SETEX key expiration value` command.
Example¶
err := rdb.SetEX(ctx, "key", "value", time.Hour).Err()if err != nil {panic(err)}func (Client)SetNX¶
func (c Client) SetNX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmd
SetNX Redis `SET key value [expiration] NX` command.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (Client)SetXX¶
func (c Client) SetXX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmd
SetXX Redis `SET key value [expiration] XX` command.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (Client)ShutdownNoSave¶
func (Client)ShutdownSave¶
func (Client)SlowLogGet¶
func (c Client) SlowLogGet(ctxcontext.Context, numint64) *SlowLogCmd
Example¶
const key = "slowlog-log-slower-than"old := rdb.ConfigGet(ctx, key).Val()rdb.ConfigSet(ctx, key, "0")defer rdb.ConfigSet(ctx, key, old[1].(string))if err := rdb.Do(ctx, "slowlog", "reset").Err(); err != nil {panic(err)}rdb.Set(ctx, "test", "true", 0)result, err := rdb.SlowLogGet(ctx, -1).Result()if err != nil {panic(err)}fmt.Println(len(result))Output:2
func (Client)SortInterfaces¶
func (*Client)Subscribe¶
Subscribe subscribes the client to the specified channels.Channels can be omitted to create empty subscription.Note that this method does not wait on a response from Redis, so thesubscription may not be active immediately. To force the connection to wait,you may call the Receive() method on the returned *PubSub like so:
sub := client.Subscribe(queryResp)iface, err := sub.Receive()if err != nil { // handle error}// Should be *Subscription, but others are possible if other actions have been// taken on sub since it was created.switch iface.(type) {case *Subscription: // subscribe succeededcase *Message: // received first messagecase *Pong: // pong receiveddefault: // handle error}ch := sub.Channel()func (*Client)TxPipeline¶
TxPipeline acts like Pipeline, but wraps queued commands with MULTI/EXEC.
Example¶
pipe := rdb.TxPipeline()incr := pipe.Incr(ctx, "tx_pipeline_counter")pipe.Expire(ctx, "tx_pipeline_counter", time.Hour)// Execute//// MULTI// INCR pipeline_counter// EXPIRE pipeline_counts 3600// EXEC//// using one rdb-server roundtrip._, err := pipe.Exec(ctx)fmt.Println(incr.Val(), err)
Output:1 <nil>
func (*Client)TxPipelined¶
Example¶
var incr *redis.IntCmd_, err := rdb.TxPipelined(ctx, func(pipe redis.Pipeliner) error {incr = pipe.Incr(ctx, "tx_pipelined_counter")pipe.Expire(ctx, "tx_pipelined_counter", time.Hour)return nil})fmt.Println(incr.Val(), err)Output:1 <nil>
func (*Client)Watch¶
Watch prepares a transaction and marks the keys to be watchedfor conditional execution if there are any keys.
The transaction is automatically closed when fn exits.
Example¶
const maxRetries = 1000// Increment transactionally increments key using GET and SET commands.increment := func(key string) error {// Transactional function.txf := func(tx *redis.Tx) error {// Get current value or zero.n, err := tx.Get(ctx, key).Int()if err != nil && err != redis.Nil {return err}// Actual opperation (local in optimistic lock).n++// Operation is committed only if the watched keys remain unchanged._, err = tx.TxPipelined(ctx, func(pipe redis.Pipeliner) error {pipe.Set(ctx, key, n, 0)return nil})return err}for i := 0; i < maxRetries; i++ {err := rdb.Watch(ctx, txf, key)if err == nil {// Success.return nil}if err == redis.TxFailedErr {// Optimistic lock lost. Retry.continue}// Return any other error.return err}return errors.New("increment reached maximum number of retries")}var wg sync.WaitGroupfor i := 0; i < 100; i++ {wg.Add(1)go func() {defer wg.Done()if err := increment("counter3"); err != nil {fmt.Println("increment error:", err)}}()}wg.Wait()n, err := rdb.Get(ctx, "counter3").Int()fmt.Println("ended with", n, err)Output:ended with 100 <nil>
Example (Instrumentation)¶
rdb := redis.NewClient(&redis.Options{Addr: ":6379",})rdb.AddHook(redisHook{})rdb.Watch(ctx, func(tx *redis.Tx) error {tx.Ping(ctx)tx.Ping(ctx)return nil}, "foo")Output:starting processing: <watch foo: >finished processing: <watch foo: OK>starting processing: <ping: >finished processing: <ping: PONG>starting processing: <ping: >finished processing: <ping: PONG>starting processing: <unwatch: >finished processing: <unwatch: OK>
func (Client)XAdd¶
XAdd a.Limit has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046
func (Client)XAutoClaim¶added inv8.11.0
func (c Client) XAutoClaim(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimCmd
func (Client)XAutoClaimJustID¶added inv8.11.0
func (c Client) XAutoClaimJustID(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd
func (Client)XClaim¶
func (c Client) XClaim(ctxcontext.Context, a *XClaimArgs) *XMessageSliceCmd
func (Client)XClaimJustID¶
func (c Client) XClaimJustID(ctxcontext.Context, a *XClaimArgs) *StringSliceCmd
func (Client)XGroupCreate¶
func (Client)XGroupCreateConsumer¶added inv8.11.0
func (Client)XGroupCreateMkStream¶
func (Client)XGroupDelConsumer¶
func (Client)XGroupDestroy¶
func (Client)XGroupSetID¶
func (Client)XInfoConsumers¶added inv8.6.0
func (c Client) XInfoConsumers(ctxcontext.Context, keystring, groupstring) *XInfoConsumersCmd
func (Client)XInfoGroups¶
func (c Client) XInfoGroups(ctxcontext.Context, keystring) *XInfoGroupsCmd
func (Client)XInfoStream¶added inv8.2.1
func (c Client) XInfoStream(ctxcontext.Context, keystring) *XInfoStreamCmd
func (Client)XInfoStreamFull¶added inv8.9.0
func (c Client) XInfoStreamFull(ctxcontext.Context, keystring, countint) *XInfoStreamFullCmd
XInfoStreamFull XINFO STREAM FULL [COUNT count]redis-server >= 6.0.
func (Client)XPending¶
func (c Client) XPending(ctxcontext.Context, stream, groupstring) *XPendingCmd
func (Client)XPendingExt¶
func (c Client) XPendingExt(ctxcontext.Context, a *XPendingExtArgs) *XPendingExtCmd
func (Client)XRange¶
func (c Client) XRange(ctxcontext.Context, stream, start, stopstring) *XMessageSliceCmd
func (Client)XRangeN¶
func (c Client) XRangeN(ctxcontext.Context, stream, start, stopstring, countint64) *XMessageSliceCmd
func (Client)XReadGroup¶
func (c Client) XReadGroup(ctxcontext.Context, a *XReadGroupArgs) *XStreamSliceCmd
func (Client)XReadStreams¶
func (c Client) XReadStreams(ctxcontext.Context, streams ...string) *XStreamSliceCmd
func (Client)XRevRange¶
func (c Client) XRevRange(ctxcontext.Context, stream, start, stopstring) *XMessageSliceCmd
func (Client)XRevRangeN¶
func (c Client) XRevRangeN(ctxcontext.Context, stream, start, stopstring, countint64) *XMessageSliceCmd
func (Client)XTrimMaxLen¶added inv8.11.0
XTrimMaxLen No `~` rules are used, `limit` cannot be used.cmd: XTRIM key MAXLEN maxLen
func (Client)XTrimMaxLenApprox¶added inv8.11.0
XTrimMaxLenApprox LIMIT has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046cmd: XTRIM key MAXLEN ~ maxLen LIMIT limit
func (Client)XTrimMinID¶added inv8.11.0
XTrimMinID No `~` rules are used, `limit` cannot be used.cmd: XTRIM key MINID minID
func (Client)XTrimMinIDApprox¶added inv8.11.0
XTrimMinIDApprox LIMIT has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046cmd: XTRIM key MINID ~ minID LIMIT limit
func (Client)ZAddArgsIncr¶added inv8.11.0
func (Client)ZAddCh¶
ZAddCh Redis `ZADD key CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{Ch: true,Members: []Z,})remove in v9.func (Client)ZAddNXCh¶
ZAddNXCh Redis `ZADD key NX CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{NX: true,Ch: true,Members: []Z,})remove in v9.func (Client)ZAddXXCh¶
ZAddXXCh Redis `ZADD key XX CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{XX: true,Ch: true,Members: []Z,})remove in v9.func (Client)ZDiff¶added inv8.9.0
func (c Client) ZDiff(ctxcontext.Context, keys ...string) *StringSliceCmd
ZDiff redis-server version >= 6.2.0.
func (Client)ZDiffStore¶added inv8.10.0
ZDiffStore redis-server version >=6.2.0.
func (Client)ZDiffWithScores¶added inv8.9.0
ZDiffWithScores redis-server version >= 6.2.0.
func (Client)ZIncr¶
ZIncr Redis `ZADD key INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{Members: []Z,})remove in v9.func (Client)ZIncrNX¶
ZIncrNX Redis `ZADD key NX INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{NX: true,Members: []Z,})remove in v9.func (Client)ZIncrXX¶
ZIncrXX Redis `ZADD key XX INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{XX: true,Members: []Z,})remove in v9.func (Client)ZInter¶added inv8.10.0
func (c Client) ZInter(ctxcontext.Context, store *ZStore) *StringSliceCmd
func (Client)ZInterStore¶
func (Client)ZInterWithScores¶added inv8.10.0
func (Client)ZMScore¶added inv8.8.0
func (c Client) ZMScore(ctxcontext.Context, keystring, members ...string) *FloatSliceCmd
func (Client)ZRandMember¶added inv8.8.1
func (c Client) ZRandMember(ctxcontext.Context, keystring, countint, withScoresbool) *StringSliceCmd
ZRandMember redis-server version >= 6.2.0.
func (Client)ZRange¶
func (c Client) ZRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (Client)ZRangeArgs¶added inv8.11.0
func (c Client) ZRangeArgs(ctxcontext.Context, zZRangeArgs) *StringSliceCmd
func (Client)ZRangeArgsWithScores¶added inv8.11.0
func (c Client) ZRangeArgsWithScores(ctxcontext.Context, zZRangeArgs) *ZSliceCmd
func (Client)ZRangeByLex¶
func (c Client) ZRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Client)ZRangeByScore¶
func (c Client) ZRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Client)ZRangeByScoreWithScores¶
func (Client)ZRangeStore¶added inv8.11.0
func (c Client) ZRangeStore(ctxcontext.Context, dststring, zZRangeArgs) *IntCmd
func (Client)ZRangeWithScores¶
func (Client)ZRemRangeByLex¶
func (Client)ZRemRangeByRank¶
func (Client)ZRemRangeByScore¶
func (Client)ZRevRange¶
func (c Client) ZRevRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (Client)ZRevRangeByLex¶
func (c Client) ZRevRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Client)ZRevRangeByScore¶
func (c Client) ZRevRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Client)ZRevRangeByScoreWithScores¶
func (Client)ZRevRangeWithScores¶
func (Client)ZUnion¶added inv8.11.0
func (c Client) ZUnion(ctxcontext.Context, storeZStore) *StringSliceCmd
func (Client)ZUnionStore¶
typeClusterClient¶
type ClusterClient struct {// contains filtered or unexported fields}ClusterClient is a Redis Cluster client representing a pool of zeroor more underlying connections. It's safe for concurrent use bymultiple goroutines.
funcNewClusterClient¶
func NewClusterClient(opt *ClusterOptions) *ClusterClient
NewClusterClient returns a Redis Cluster client as described inhttp://redis.io/topics/cluster-spec.
Example¶
// See http://redis.io/topics/cluster-tutorial for instructions// how to setup Redis Cluster.rdb := redis.NewClusterClient(&redis.ClusterOptions{Addrs: []string{":7000", ":7001", ":7002", ":7003", ":7004", ":7005"},})rdb.Ping(ctx)Example (ManualSetup)¶
Following example creates a cluster from 2 master nodes and 2 slave nodeswithout using cluster mode or Redis Sentinel.
// clusterSlots returns cluster slots information.// It can use service like ZooKeeper to maintain configuration information// and Cluster.ReloadState to manually trigger state reloading.clusterSlots := func(ctx context.Context) ([]redis.ClusterSlot, error) {slots := []redis.ClusterSlot{// First node with 1 master and 1 slave.{Start: 0,End: 8191,Nodes: []redis.ClusterNode{{Addr: ":7000", // master}, {Addr: ":8000", // 1st slave}},},// Second node with 1 master and 1 slave.{Start: 8192,End: 16383,Nodes: []redis.ClusterNode{{Addr: ":7001", // master}, {Addr: ":8001", // 1st slave}},},}return slots, nil}rdb := redis.NewClusterClient(&redis.ClusterOptions{ClusterSlots: clusterSlots,RouteRandomly: true,})rdb.Ping(ctx)// ReloadState reloads cluster state. It calls ClusterSlots func// to get cluster slots information.rdb.ReloadState(ctx)funcNewFailoverClusterClient¶
func NewFailoverClusterClient(failoverOpt *FailoverOptions) *ClusterClient
NewFailoverClusterClient returns a client that supports routing read-only commandsto a slave node.
func (ClusterClient)BRPopLPush¶
func (ClusterClient)BZPopMax¶
func (c ClusterClient) BZPopMax(ctxcontext.Context, timeouttime.Duration, keys ...string) *ZWithKeyCmd
BZPopMax Redis `BZPOPMAX key [key ...] timeout` command.
func (ClusterClient)BZPopMin¶
func (c ClusterClient) BZPopMin(ctxcontext.Context, timeouttime.Duration, keys ...string) *ZWithKeyCmd
BZPopMin Redis `BZPOPMIN key [key ...] timeout` command.
func (ClusterClient)BgRewriteAOF¶
func (ClusterClient)BitField¶
func (c ClusterClient) BitField(ctxcontext.Context, keystring, args ...interface{}) *IntSliceCmd
func (ClusterClient)ClientGetName¶
ClientGetName returns the name of the connection.
func (ClusterClient)ClientKill¶
func (ClusterClient)ClientKillByFilter¶
ClientKillByFilter is new style syntax, while the ClientKill is old
CLIENT KILL <option> [value] ... <option> [value]
func (ClusterClient)ClientList¶
func (ClusterClient)ClientPause¶
func (ClusterClient)ClientUnblock¶
func (ClusterClient)ClientUnblockWithError¶
func (*ClusterClient)Close¶
func (c *ClusterClient) Close()error
Close closes the cluster client, releasing any open resources.
It is rare to Close a ClusterClient, as the ClusterClient is meantto be long-lived and shared between many goroutines.
func (ClusterClient)ClusterAddSlots¶
func (ClusterClient)ClusterAddSlotsRange¶
func (ClusterClient)ClusterCountFailureReports¶
func (ClusterClient)ClusterCountKeysInSlot¶
func (ClusterClient)ClusterDelSlots¶
func (ClusterClient)ClusterDelSlotsRange¶
func (ClusterClient)ClusterFailover¶
func (ClusterClient)ClusterForget¶
func (ClusterClient)ClusterGetKeysInSlot¶
func (c ClusterClient) ClusterGetKeysInSlot(ctxcontext.Context, slotint, countint) *StringSliceCmd
func (ClusterClient)ClusterInfo¶
func (ClusterClient)ClusterKeySlot¶
func (ClusterClient)ClusterMeet¶
func (ClusterClient)ClusterNodes¶
func (ClusterClient)ClusterReplicate¶
func (ClusterClient)ClusterResetHard¶
func (ClusterClient)ClusterResetSoft¶
func (ClusterClient)ClusterSaveConfig¶
func (ClusterClient)ClusterSlaves¶
func (c ClusterClient) ClusterSlaves(ctxcontext.Context, nodeIDstring) *StringSliceCmd
func (ClusterClient)ClusterSlots¶
func (c ClusterClient) ClusterSlots(ctxcontext.Context) *ClusterSlotsCmd
func (ClusterClient)Command¶
func (c ClusterClient) Command(ctxcontext.Context) *CommandsInfoCmd
func (ClusterClient)ConfigResetStat¶
func (ClusterClient)ConfigRewrite¶
func (*ClusterClient)Context¶
func (c *ClusterClient) Context()context.Context
func (ClusterClient)DebugObject¶
func (*ClusterClient)Do¶
func (c *ClusterClient) Do(ctxcontext.Context, args ...interface{}) *Cmd
Do creates a Cmd from the args and processes the cmd.
func (ClusterClient)FlushAllAsync¶
func (ClusterClient)FlushDBAsync¶
func (*ClusterClient)ForEachMaster¶
func (c *ClusterClient) ForEachMaster(ctxcontext.Context,fn func(ctxcontext.Context, client *Client)error,)error
ForEachMaster concurrently calls the fn on each master node in the cluster.It returns the first error if any.
func (*ClusterClient)ForEachShard¶
func (c *ClusterClient) ForEachShard(ctxcontext.Context,fn func(ctxcontext.Context, client *Client)error,)error
ForEachShard concurrently calls the fn on each known node in the cluster.It returns the first error if any.
func (*ClusterClient)ForEachSlave¶
func (c *ClusterClient) ForEachSlave(ctxcontext.Context,fn func(ctxcontext.Context, client *Client)error,)error
ForEachSlave concurrently calls the fn on each slave node in the cluster.It returns the first error if any.
func (ClusterClient)GeoAdd¶
func (c ClusterClient) GeoAdd(ctxcontext.Context, keystring, geoLocation ...*GeoLocation) *IntCmd
func (ClusterClient)GeoHash¶
func (c ClusterClient) GeoHash(ctxcontext.Context, keystring, members ...string) *StringSliceCmd
func (ClusterClient)GeoRadius¶
func (c ClusterClient) GeoRadius(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery,) *GeoLocationCmd
GeoRadius is a read-only GEORADIUS_RO command.
func (ClusterClient)GeoRadiusByMember¶
func (c ClusterClient) GeoRadiusByMember(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery,) *GeoLocationCmd
GeoRadiusByMember is a read-only GEORADIUSBYMEMBER_RO command.
func (ClusterClient)GeoRadiusByMemberStore¶
func (c ClusterClient) GeoRadiusByMemberStore(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery,) *IntCmd
GeoRadiusByMemberStore is a writing GEORADIUSBYMEMBER command.
func (ClusterClient)GeoRadiusStore¶
func (c ClusterClient) GeoRadiusStore(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery,) *IntCmd
GeoRadiusStore is a writing GEORADIUS command.
func (ClusterClient)GeoSearch¶added inv8.11.1
func (c ClusterClient) GeoSearch(ctxcontext.Context, keystring, q *GeoSearchQuery) *StringSliceCmd
func (ClusterClient)GeoSearchLocation¶added inv8.11.1
func (c ClusterClient) GeoSearchLocation(ctxcontext.Context, keystring, q *GeoSearchLocationQuery,) *GeoSearchLocationCmd
func (ClusterClient)GeoSearchStore¶added inv8.11.1
func (c ClusterClient) GeoSearchStore(ctxcontext.Context, key, storestring, q *GeoSearchStoreQuery) *IntCmd
func (ClusterClient)Get¶
Get Redis `GET key` command. It returns redis.Nil error when key does not exist.
func (ClusterClient)GetEx¶added inv8.8.1
GetEx An expiration of zero removes the TTL associated with the key (i.e. GETEX key persist).Requires Redis >= 6.2.0.
func (ClusterClient)HGetAll¶
func (c ClusterClient) HGetAll(ctxcontext.Context, keystring) *StringStringMapCmd
func (ClusterClient)HIncrByFloat¶
func (ClusterClient)HKeys¶
func (c ClusterClient) HKeys(ctxcontext.Context, keystring) *StringSliceCmd
func (ClusterClient)HMGet¶
HMGet returns the values for the specified fields in the hash stored at key.It returns an interface{} to distinguish between empty string and nil value.
func (ClusterClient)HMSet¶
HMSet is a deprecated version of HSet left for compatibility with Redis 3.
func (ClusterClient)HRandField¶added inv8.8.1
func (c ClusterClient) HRandField(ctxcontext.Context, keystring, countint, withValuesbool) *StringSliceCmd
HRandField redis-server version >= 6.2.0.
func (ClusterClient)HSet¶
HSet accepts values in following formats:
- HSet("myhash", "key1", "value1", "key2", "value2")
- HSet("myhash", []string{"key1", "value1", "key2", "value2"})
- HSet("myhash", map[string]interface{}{"key1": "value1", "key2": "value2"})
Note that it requires Redis v4 for multiple field/value pairs support.
func (ClusterClient)HVals¶
func (c ClusterClient) HVals(ctxcontext.Context, keystring) *StringSliceCmd
func (ClusterClient)IncrByFloat¶
func (ClusterClient)Keys¶
func (c ClusterClient) Keys(ctxcontext.Context, patternstring) *StringSliceCmd
func (ClusterClient)LInsertAfter¶
func (ClusterClient)LInsertBefore¶
func (ClusterClient)LPopCount¶added inv8.8.3
func (c ClusterClient) LPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmd
func (ClusterClient)LRange¶
func (c ClusterClient) LRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (ClusterClient)MSet¶
MSet is like Set but accepts multiple values:
- MSet("key1", "value1", "key2", "value2")
- MSet([]string{"key1", "value1", "key2", "value2"})
- MSet(map[string]interface{}{"key1": "value1", "key2": "value2"})
func (ClusterClient)MSetNX¶
MSetNX is like SetNX but accepts multiple values:
- MSetNX("key1", "value1", "key2", "value2")
- MSetNX([]string{"key1", "value1", "key2", "value2"})
- MSetNX(map[string]interface{}{"key1": "value1", "key2": "value2"})
func (*ClusterClient)MasterForKey¶added inv8.4.3
MasterForKey return a client to the master node for a particular key.
func (ClusterClient)MemoryUsage¶
func (ClusterClient)ObjectEncoding¶
func (ClusterClient)ObjectIdleTime¶
func (c ClusterClient) ObjectIdleTime(ctxcontext.Context, keystring) *DurationCmd
func (ClusterClient)ObjectRefCount¶
func (*ClusterClient)Options¶
func (c *ClusterClient) Options() *ClusterOptions
Options returns read-only Options that were used to create the client.
func (*ClusterClient)PSubscribe¶
func (c *ClusterClient) PSubscribe(ctxcontext.Context, channels ...string) *PubSub
PSubscribe subscribes the client to the given patterns.Patterns can be omitted to create empty subscription.
func (*ClusterClient)Pipeline¶
func (c *ClusterClient) Pipeline()Pipeliner
func (*ClusterClient)PoolStats¶
func (c *ClusterClient) PoolStats() *PoolStats
PoolStats returns accumulated connection pool stats.
func (ClusterClient)PubSubChannels¶
func (c ClusterClient) PubSubChannels(ctxcontext.Context, patternstring) *StringSliceCmd
func (ClusterClient)PubSubNumPat¶
func (ClusterClient)PubSubNumSub¶
func (c ClusterClient) PubSubNumSub(ctxcontext.Context, channels ...string) *StringIntMapCmd
func (ClusterClient)RPopCount¶added inv8.11.1
func (c ClusterClient) RPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmd
func (*ClusterClient)ReloadState¶
func (c *ClusterClient) ReloadState(ctxcontext.Context)
ReloadState reloads cluster state. If available it calls ClusterSlots functo get cluster slots information.
func (ClusterClient)RestoreReplace¶
func (ClusterClient)SDiff¶
func (c ClusterClient) SDiff(ctxcontext.Context, keys ...string) *StringSliceCmd
func (ClusterClient)SDiffStore¶
func (ClusterClient)SInter¶
func (c ClusterClient) SInter(ctxcontext.Context, keys ...string) *StringSliceCmd
func (ClusterClient)SInterStore¶
func (ClusterClient)SMIsMember¶added inv8.8.3
func (c ClusterClient) SMIsMember(ctxcontext.Context, keystring, members ...interface{}) *BoolSliceCmd
SMIsMember Redis `SMISMEMBER key member [member ...]` command.
func (ClusterClient)SMembers¶
func (c ClusterClient) SMembers(ctxcontext.Context, keystring) *StringSliceCmd
SMembers Redis `SMEMBERS key` command output as a slice.
func (ClusterClient)SMembersMap¶
func (c ClusterClient) SMembersMap(ctxcontext.Context, keystring) *StringStructMapCmd
SMembersMap Redis `SMEMBERS key` command output as a map.
func (ClusterClient)SPopN¶
func (c ClusterClient) SPopN(ctxcontext.Context, keystring, countint64) *StringSliceCmd
SPopN Redis `SPOP key count` command.
func (ClusterClient)SRandMember¶
SRandMember Redis `SRANDMEMBER key` command.
func (ClusterClient)SRandMemberN¶
func (c ClusterClient) SRandMemberN(ctxcontext.Context, keystring, countint64) *StringSliceCmd
SRandMemberN Redis `SRANDMEMBER key count` command.
func (ClusterClient)SUnion¶
func (c ClusterClient) SUnion(ctxcontext.Context, keys ...string) *StringSliceCmd
func (ClusterClient)SUnionStore¶
func (*ClusterClient)ScriptExists¶
func (c *ClusterClient) ScriptExists(ctxcontext.Context, hashes ...string) *BoolSliceCmd
func (*ClusterClient)ScriptFlush¶
func (c *ClusterClient) ScriptFlush(ctxcontext.Context) *StatusCmd
func (ClusterClient)ScriptKill¶
func (*ClusterClient)ScriptLoad¶
func (c *ClusterClient) ScriptLoad(ctxcontext.Context, scriptstring) *StringCmd
func (ClusterClient)Set¶
func (c ClusterClient) Set(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmd
Set Redis `SET key value [expiration]` command.Use expiration for `SETEX`-like behavior.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (ClusterClient)SetArgs¶added inv8.6.0
func (c ClusterClient) SetArgs(ctxcontext.Context, keystring, value interface{}, aSetArgs) *StatusCmd
SetArgs supports all the options that the SET command supports.It is the alternative to the Set function when you wantto have more control over the options.
func (ClusterClient)SetEX¶added inv8.3.3
func (c ClusterClient) SetEX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmd
SetEX Redis `SETEX key expiration value` command.
func (ClusterClient)SetNX¶
func (c ClusterClient) SetNX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmd
SetNX Redis `SET key value [expiration] NX` command.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (ClusterClient)SetXX¶
func (c ClusterClient) SetXX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmd
SetXX Redis `SET key value [expiration] XX` command.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (ClusterClient)ShutdownNoSave¶
func (ClusterClient)ShutdownSave¶
func (*ClusterClient)SlaveForKey¶added inv8.4.4
SlaveForKey gets a client for a replica node to run any command on it.This is especially useful if we want to run a particular lua script which hasonly read only commands on the replica.This is because other redis commands generally have a flag that points thatthey are read only and automatically run on the replica nodesif ClusterOptions.ReadOnly flag is set to true.
func (ClusterClient)SlowLogGet¶
func (c ClusterClient) SlowLogGet(ctxcontext.Context, numint64) *SlowLogCmd
func (ClusterClient)Sort¶
func (c ClusterClient) Sort(ctxcontext.Context, keystring, sort *Sort) *StringSliceCmd
func (ClusterClient)SortInterfaces¶
func (*ClusterClient)Subscribe¶
func (c *ClusterClient) Subscribe(ctxcontext.Context, channels ...string) *PubSub
Subscribe subscribes the client to the specified channels.Channels can be omitted to create empty subscription.
func (*ClusterClient)TxPipeline¶
func (c *ClusterClient) TxPipeline()Pipeliner
TxPipeline acts like Pipeline, but wraps queued commands with MULTI/EXEC.
func (*ClusterClient)TxPipelined¶
func (*ClusterClient)WithContext¶
func (c *ClusterClient) WithContext(ctxcontext.Context) *ClusterClient
func (ClusterClient)XAdd¶
XAdd a.Limit has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046
func (ClusterClient)XAutoClaim¶added inv8.11.0
func (c ClusterClient) XAutoClaim(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimCmd
func (ClusterClient)XAutoClaimJustID¶added inv8.11.0
func (c ClusterClient) XAutoClaimJustID(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd
func (ClusterClient)XClaim¶
func (c ClusterClient) XClaim(ctxcontext.Context, a *XClaimArgs) *XMessageSliceCmd
func (ClusterClient)XClaimJustID¶
func (c ClusterClient) XClaimJustID(ctxcontext.Context, a *XClaimArgs) *StringSliceCmd
func (ClusterClient)XGroupCreate¶
func (ClusterClient)XGroupCreateConsumer¶added inv8.11.0
func (ClusterClient)XGroupCreateMkStream¶
func (ClusterClient)XGroupDelConsumer¶
func (ClusterClient)XGroupDestroy¶
func (ClusterClient)XGroupSetID¶
func (ClusterClient)XInfoConsumers¶added inv8.6.0
func (c ClusterClient) XInfoConsumers(ctxcontext.Context, keystring, groupstring) *XInfoConsumersCmd
func (ClusterClient)XInfoGroups¶
func (c ClusterClient) XInfoGroups(ctxcontext.Context, keystring) *XInfoGroupsCmd
func (ClusterClient)XInfoStream¶added inv8.2.1
func (c ClusterClient) XInfoStream(ctxcontext.Context, keystring) *XInfoStreamCmd
func (ClusterClient)XInfoStreamFull¶added inv8.9.0
func (c ClusterClient) XInfoStreamFull(ctxcontext.Context, keystring, countint) *XInfoStreamFullCmd
XInfoStreamFull XINFO STREAM FULL [COUNT count]redis-server >= 6.0.
func (ClusterClient)XPending¶
func (c ClusterClient) XPending(ctxcontext.Context, stream, groupstring) *XPendingCmd
func (ClusterClient)XPendingExt¶
func (c ClusterClient) XPendingExt(ctxcontext.Context, a *XPendingExtArgs) *XPendingExtCmd
func (ClusterClient)XRange¶
func (c ClusterClient) XRange(ctxcontext.Context, stream, start, stopstring) *XMessageSliceCmd
func (ClusterClient)XRangeN¶
func (c ClusterClient) XRangeN(ctxcontext.Context, stream, start, stopstring, countint64) *XMessageSliceCmd
func (ClusterClient)XRead¶
func (c ClusterClient) XRead(ctxcontext.Context, a *XReadArgs) *XStreamSliceCmd
func (ClusterClient)XReadGroup¶
func (c ClusterClient) XReadGroup(ctxcontext.Context, a *XReadGroupArgs) *XStreamSliceCmd
func (ClusterClient)XReadStreams¶
func (c ClusterClient) XReadStreams(ctxcontext.Context, streams ...string) *XStreamSliceCmd
func (ClusterClient)XRevRange¶
func (c ClusterClient) XRevRange(ctxcontext.Context, stream, start, stopstring) *XMessageSliceCmd
func (ClusterClient)XRevRangeN¶
func (c ClusterClient) XRevRangeN(ctxcontext.Context, stream, start, stopstring, countint64) *XMessageSliceCmd
func (ClusterClient)XTrimMaxLen¶added inv8.11.0
XTrimMaxLen No `~` rules are used, `limit` cannot be used.cmd: XTRIM key MAXLEN maxLen
func (ClusterClient)XTrimMaxLenApprox¶added inv8.11.0
XTrimMaxLenApprox LIMIT has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046cmd: XTRIM key MAXLEN ~ maxLen LIMIT limit
func (ClusterClient)XTrimMinID¶added inv8.11.0
XTrimMinID No `~` rules are used, `limit` cannot be used.cmd: XTRIM key MINID minID
func (ClusterClient)XTrimMinIDApprox¶added inv8.11.0
func (c ClusterClient) XTrimMinIDApprox(ctxcontext.Context, keystring, minIDstring, limitint64) *IntCmd
XTrimMinIDApprox LIMIT has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046cmd: XTRIM key MINID ~ minID LIMIT limit
func (ClusterClient)ZAddArgsIncr¶added inv8.11.0
func (ClusterClient)ZAddCh¶
ZAddCh Redis `ZADD key CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{Ch: true,Members: []Z,})remove in v9.func (ClusterClient)ZAddNXCh¶
ZAddNXCh Redis `ZADD key NX CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{NX: true,Ch: true,Members: []Z,})remove in v9.func (ClusterClient)ZAddXXCh¶
ZAddXXCh Redis `ZADD key XX CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{XX: true,Ch: true,Members: []Z,})remove in v9.func (ClusterClient)ZDiff¶added inv8.9.0
func (c ClusterClient) ZDiff(ctxcontext.Context, keys ...string) *StringSliceCmd
ZDiff redis-server version >= 6.2.0.
func (ClusterClient)ZDiffStore¶added inv8.10.0
ZDiffStore redis-server version >=6.2.0.
func (ClusterClient)ZDiffWithScores¶added inv8.9.0
ZDiffWithScores redis-server version >= 6.2.0.
func (ClusterClient)ZIncr¶
ZIncr Redis `ZADD key INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{Members: []Z,})remove in v9.func (ClusterClient)ZIncrNX¶
ZIncrNX Redis `ZADD key NX INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{NX: true,Members: []Z,})remove in v9.func (ClusterClient)ZIncrXX¶
ZIncrXX Redis `ZADD key XX INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{XX: true,Members: []Z,})remove in v9.func (ClusterClient)ZInter¶added inv8.10.0
func (c ClusterClient) ZInter(ctxcontext.Context, store *ZStore) *StringSliceCmd
func (ClusterClient)ZInterStore¶
func (ClusterClient)ZInterWithScores¶added inv8.10.0
func (ClusterClient)ZMScore¶added inv8.8.0
func (c ClusterClient) ZMScore(ctxcontext.Context, keystring, members ...string) *FloatSliceCmd
func (ClusterClient)ZRandMember¶added inv8.8.1
func (c ClusterClient) ZRandMember(ctxcontext.Context, keystring, countint, withScoresbool) *StringSliceCmd
ZRandMember redis-server version >= 6.2.0.
func (ClusterClient)ZRange¶
func (c ClusterClient) ZRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (ClusterClient)ZRangeArgs¶added inv8.11.0
func (c ClusterClient) ZRangeArgs(ctxcontext.Context, zZRangeArgs) *StringSliceCmd
func (ClusterClient)ZRangeArgsWithScores¶added inv8.11.0
func (c ClusterClient) ZRangeArgsWithScores(ctxcontext.Context, zZRangeArgs) *ZSliceCmd
func (ClusterClient)ZRangeByLex¶
func (c ClusterClient) ZRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (ClusterClient)ZRangeByScore¶
func (c ClusterClient) ZRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (ClusterClient)ZRangeByScoreWithScores¶
func (ClusterClient)ZRangeStore¶added inv8.11.0
func (c ClusterClient) ZRangeStore(ctxcontext.Context, dststring, zZRangeArgs) *IntCmd
func (ClusterClient)ZRangeWithScores¶
func (ClusterClient)ZRemRangeByLex¶
func (ClusterClient)ZRemRangeByRank¶
func (ClusterClient)ZRemRangeByScore¶
func (ClusterClient)ZRevRange¶
func (c ClusterClient) ZRevRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (ClusterClient)ZRevRangeByLex¶
func (c ClusterClient) ZRevRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (ClusterClient)ZRevRangeByScore¶
func (c ClusterClient) ZRevRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (ClusterClient)ZRevRangeByScoreWithScores¶
func (ClusterClient)ZRevRangeWithScores¶
func (ClusterClient)ZUnion¶added inv8.11.0
func (c ClusterClient) ZUnion(ctxcontext.Context, storeZStore) *StringSliceCmd
func (ClusterClient)ZUnionStore¶
typeClusterNode¶
typeClusterOptions¶
type ClusterOptions struct {// A seed list of host:port addresses of cluster nodes.Addrs []string// NewClient creates a cluster node client with provided name and options.NewClient func(opt *Options) *Client// The maximum number of retries before giving up. Command is retried// on network errors and MOVED/ASK redirects.// Default is 3 retries.MaxRedirectsint// Enables read-only commands on slave nodes.ReadOnlybool// Allows routing read-only commands to the closest master or slave node.// It automatically enables ReadOnly.RouteByLatencybool// Allows routing read-only commands to the random master or slave node.// It automatically enables ReadOnly.RouteRandomlybool// Optional function that returns cluster slots information.// It is useful to manually create cluster of standalone Redis servers// and load-balance read/write operations between master and slaves.// It can use service like ZooKeeper to maintain configuration information// and Cluster.ReloadState to manually trigger state reloading.ClusterSlots func(context.Context) ([]ClusterSlot,error)Dialer func(ctxcontext.Context, network, addrstring) (net.Conn,error)OnConnect func(ctxcontext.Context, cn *Conn)errorUsernamestringPasswordstringMaxRetriesintMinRetryBackofftime.DurationMaxRetryBackofftime.DurationDialTimeouttime.DurationReadTimeouttime.DurationWriteTimeouttime.Duration// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).PoolFIFObool// PoolSize applies per cluster node and not for the whole cluster.PoolSizeintMinIdleConnsintMaxConnAgetime.DurationPoolTimeouttime.DurationIdleTimeouttime.DurationIdleCheckFrequencytime.DurationTLSConfig *tls.Config}ClusterOptions are used to configure a cluster client and should bepassed to NewClusterClient.
typeClusterSlot¶
type ClusterSlot struct {StartintEndintNodes []ClusterNode}typeClusterSlotsCmd¶
type ClusterSlotsCmd struct {// contains filtered or unexported fields}funcNewClusterSlotsCmd¶
func NewClusterSlotsCmd(ctxcontext.Context, args ...interface{}) *ClusterSlotsCmd
funcNewClusterSlotsCmdResult¶
func NewClusterSlotsCmdResult(val []ClusterSlot, errerror) *ClusterSlotsCmd
NewClusterSlotsCmdResult returns a ClusterSlotsCmd initialised with val and err for testing.
func (*ClusterSlotsCmd)Result¶
func (cmd *ClusterSlotsCmd) Result() ([]ClusterSlot,error)
func (*ClusterSlotsCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *ClusterSlotsCmd) SetFirstKeyPos(keyPosint8)
func (*ClusterSlotsCmd)SetVal¶added inv8.11.4
func (cmd *ClusterSlotsCmd) SetVal(val []ClusterSlot)
func (*ClusterSlotsCmd)String¶
func (cmd *ClusterSlotsCmd) String()string
func (*ClusterSlotsCmd)Val¶
func (cmd *ClusterSlotsCmd) Val() []ClusterSlot
typeCmd¶
type Cmd struct {// contains filtered or unexported fields}funcNewCmdResult¶
NewCmdResult returns a Cmd initialised with val and err for testing.
func (*Cmd)Float32Slice¶added inv8.11.4
func (*Cmd)Float64Slice¶added inv8.11.4
func (*Cmd)Int64Slice¶added inv8.11.4
func (*Cmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *Cmd) SetFirstKeyPos(keyPosint8)
func (*Cmd)StringSlice¶added inv8.11.4
func (*Cmd)Uint64Slice¶added inv8.11.4
typeCmdable¶
type Cmdable interface {Pipeline()PipelinerPipelined(ctxcontext.Context, fn func(Pipeliner)error) ([]Cmder,error)TxPipelined(ctxcontext.Context, fn func(Pipeliner)error) ([]Cmder,error)TxPipeline()PipelinerCommand(ctxcontext.Context) *CommandsInfoCmdClientGetName(ctxcontext.Context) *StringCmdEcho(ctxcontext.Context, message interface{}) *StringCmdPing(ctxcontext.Context) *StatusCmdQuit(ctxcontext.Context) *StatusCmdDel(ctxcontext.Context, keys ...string) *IntCmdUnlink(ctxcontext.Context, keys ...string) *IntCmdDump(ctxcontext.Context, keystring) *StringCmdExists(ctxcontext.Context, keys ...string) *IntCmdExpire(ctxcontext.Context, keystring, expirationtime.Duration) *BoolCmdExpireAt(ctxcontext.Context, keystring, tmtime.Time) *BoolCmdExpireNX(ctxcontext.Context, keystring, expirationtime.Duration) *BoolCmdExpireXX(ctxcontext.Context, keystring, expirationtime.Duration) *BoolCmdExpireGT(ctxcontext.Context, keystring, expirationtime.Duration) *BoolCmdExpireLT(ctxcontext.Context, keystring, expirationtime.Duration) *BoolCmdKeys(ctxcontext.Context, patternstring) *StringSliceCmdMigrate(ctxcontext.Context, host, port, keystring, dbint, timeouttime.Duration) *StatusCmdMove(ctxcontext.Context, keystring, dbint) *BoolCmdObjectRefCount(ctxcontext.Context, keystring) *IntCmdObjectEncoding(ctxcontext.Context, keystring) *StringCmdObjectIdleTime(ctxcontext.Context, keystring) *DurationCmdPersist(ctxcontext.Context, keystring) *BoolCmdPExpire(ctxcontext.Context, keystring, expirationtime.Duration) *BoolCmdPExpireAt(ctxcontext.Context, keystring, tmtime.Time) *BoolCmdPTTL(ctxcontext.Context, keystring) *DurationCmdRandomKey(ctxcontext.Context) *StringCmdRename(ctxcontext.Context, key, newkeystring) *StatusCmdRenameNX(ctxcontext.Context, key, newkeystring) *BoolCmdRestore(ctxcontext.Context, keystring, ttltime.Duration, valuestring) *StatusCmdRestoreReplace(ctxcontext.Context, keystring, ttltime.Duration, valuestring) *StatusCmdSort(ctxcontext.Context, keystring, sort *Sort) *StringSliceCmdSortStore(ctxcontext.Context, key, storestring, sort *Sort) *IntCmdSortInterfaces(ctxcontext.Context, keystring, sort *Sort) *SliceCmdTouch(ctxcontext.Context, keys ...string) *IntCmdTTL(ctxcontext.Context, keystring) *DurationCmdType(ctxcontext.Context, keystring) *StatusCmdAppend(ctxcontext.Context, key, valuestring) *IntCmdDecr(ctxcontext.Context, keystring) *IntCmdDecrBy(ctxcontext.Context, keystring, decrementint64) *IntCmdGet(ctxcontext.Context, keystring) *StringCmdGetRange(ctxcontext.Context, keystring, start, endint64) *StringCmdGetSet(ctxcontext.Context, keystring, value interface{}) *StringCmdGetEx(ctxcontext.Context, keystring, expirationtime.Duration) *StringCmdGetDel(ctxcontext.Context, keystring) *StringCmdIncr(ctxcontext.Context, keystring) *IntCmdIncrBy(ctxcontext.Context, keystring, valueint64) *IntCmdIncrByFloat(ctxcontext.Context, keystring, valuefloat64) *FloatCmdMGet(ctxcontext.Context, keys ...string) *SliceCmdMSet(ctxcontext.Context, values ...interface{}) *StatusCmdMSetNX(ctxcontext.Context, values ...interface{}) *BoolCmdSet(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmdSetArgs(ctxcontext.Context, keystring, value interface{}, aSetArgs) *StatusCmd// TODO: rename to SetExSetEX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmdSetNX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmdSetXX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmdSetRange(ctxcontext.Context, keystring, offsetint64, valuestring) *IntCmdStrLen(ctxcontext.Context, keystring) *IntCmdCopy(ctxcontext.Context, sourceKeystring, destKeystring, dbint, replacebool) *IntCmdGetBit(ctxcontext.Context, keystring, offsetint64) *IntCmdSetBit(ctxcontext.Context, keystring, offsetint64, valueint) *IntCmdBitCount(ctxcontext.Context, keystring, bitCount *BitCount) *IntCmdBitOpAnd(ctxcontext.Context, destKeystring, keys ...string) *IntCmdBitOpOr(ctxcontext.Context, destKeystring, keys ...string) *IntCmdBitOpXor(ctxcontext.Context, destKeystring, keys ...string) *IntCmdBitOpNot(ctxcontext.Context, destKeystring, keystring) *IntCmdBitPos(ctxcontext.Context, keystring, bitint64, pos ...int64) *IntCmdBitField(ctxcontext.Context, keystring, args ...interface{}) *IntSliceCmdScan(ctxcontext.Context, cursoruint64, matchstring, countint64) *ScanCmdScanType(ctxcontext.Context, cursoruint64, matchstring, countint64, keyTypestring) *ScanCmdSScan(ctxcontext.Context, keystring, cursoruint64, matchstring, countint64) *ScanCmdHScan(ctxcontext.Context, keystring, cursoruint64, matchstring, countint64) *ScanCmdZScan(ctxcontext.Context, keystring, cursoruint64, matchstring, countint64) *ScanCmdHDel(ctxcontext.Context, keystring, fields ...string) *IntCmdHExists(ctxcontext.Context, key, fieldstring) *BoolCmdHGet(ctxcontext.Context, key, fieldstring) *StringCmdHGetAll(ctxcontext.Context, keystring) *StringStringMapCmdHIncrBy(ctxcontext.Context, key, fieldstring, incrint64) *IntCmdHIncrByFloat(ctxcontext.Context, key, fieldstring, incrfloat64) *FloatCmdHKeys(ctxcontext.Context, keystring) *StringSliceCmdHLen(ctxcontext.Context, keystring) *IntCmdHMGet(ctxcontext.Context, keystring, fields ...string) *SliceCmdHSet(ctxcontext.Context, keystring, values ...interface{}) *IntCmdHMSet(ctxcontext.Context, keystring, values ...interface{}) *BoolCmdHSetNX(ctxcontext.Context, key, fieldstring, value interface{}) *BoolCmdHVals(ctxcontext.Context, keystring) *StringSliceCmdHRandField(ctxcontext.Context, keystring, countint, withValuesbool) *StringSliceCmdBLPop(ctxcontext.Context, timeouttime.Duration, keys ...string) *StringSliceCmdBRPop(ctxcontext.Context, timeouttime.Duration, keys ...string) *StringSliceCmdBRPopLPush(ctxcontext.Context, source, destinationstring, timeouttime.Duration) *StringCmdLIndex(ctxcontext.Context, keystring, indexint64) *StringCmdLInsert(ctxcontext.Context, key, opstring, pivot, value interface{}) *IntCmdLInsertBefore(ctxcontext.Context, keystring, pivot, value interface{}) *IntCmdLInsertAfter(ctxcontext.Context, keystring, pivot, value interface{}) *IntCmdLLen(ctxcontext.Context, keystring) *IntCmdLPop(ctxcontext.Context, keystring) *StringCmdLPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmdLPos(ctxcontext.Context, keystring, valuestring, argsLPosArgs) *IntCmdLPosCount(ctxcontext.Context, keystring, valuestring, countint64, argsLPosArgs) *IntSliceCmdLPush(ctxcontext.Context, keystring, values ...interface{}) *IntCmdLPushX(ctxcontext.Context, keystring, values ...interface{}) *IntCmdLRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmdLRem(ctxcontext.Context, keystring, countint64, value interface{}) *IntCmdLSet(ctxcontext.Context, keystring, indexint64, value interface{}) *StatusCmdLTrim(ctxcontext.Context, keystring, start, stopint64) *StatusCmdRPop(ctxcontext.Context, keystring) *StringCmdRPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmdRPopLPush(ctxcontext.Context, source, destinationstring) *StringCmdRPush(ctxcontext.Context, keystring, values ...interface{}) *IntCmdRPushX(ctxcontext.Context, keystring, values ...interface{}) *IntCmdLMove(ctxcontext.Context, source, destination, srcpos, destposstring) *StringCmdBLMove(ctxcontext.Context, source, destination, srcpos, destposstring, timeouttime.Duration) *StringCmdSAdd(ctxcontext.Context, keystring, members ...interface{}) *IntCmdSCard(ctxcontext.Context, keystring) *IntCmdSDiff(ctxcontext.Context, keys ...string) *StringSliceCmdSDiffStore(ctxcontext.Context, destinationstring, keys ...string) *IntCmdSInter(ctxcontext.Context, keys ...string) *StringSliceCmdSInterStore(ctxcontext.Context, destinationstring, keys ...string) *IntCmdSIsMember(ctxcontext.Context, keystring, member interface{}) *BoolCmdSMIsMember(ctxcontext.Context, keystring, members ...interface{}) *BoolSliceCmdSMembers(ctxcontext.Context, keystring) *StringSliceCmdSMembersMap(ctxcontext.Context, keystring) *StringStructMapCmdSMove(ctxcontext.Context, source, destinationstring, member interface{}) *BoolCmdSPop(ctxcontext.Context, keystring) *StringCmdSPopN(ctxcontext.Context, keystring, countint64) *StringSliceCmdSRandMember(ctxcontext.Context, keystring) *StringCmdSRandMemberN(ctxcontext.Context, keystring, countint64) *StringSliceCmdSRem(ctxcontext.Context, keystring, members ...interface{}) *IntCmdSUnion(ctxcontext.Context, keys ...string) *StringSliceCmdSUnionStore(ctxcontext.Context, destinationstring, keys ...string) *IntCmdXAdd(ctxcontext.Context, a *XAddArgs) *StringCmdXDel(ctxcontext.Context, streamstring, ids ...string) *IntCmdXLen(ctxcontext.Context, streamstring) *IntCmdXRange(ctxcontext.Context, stream, start, stopstring) *XMessageSliceCmdXRangeN(ctxcontext.Context, stream, start, stopstring, countint64) *XMessageSliceCmdXRevRange(ctxcontext.Context, streamstring, start, stopstring) *XMessageSliceCmdXRevRangeN(ctxcontext.Context, streamstring, start, stopstring, countint64) *XMessageSliceCmdXRead(ctxcontext.Context, a *XReadArgs) *XStreamSliceCmdXReadStreams(ctxcontext.Context, streams ...string) *XStreamSliceCmdXGroupCreate(ctxcontext.Context, stream, group, startstring) *StatusCmdXGroupCreateMkStream(ctxcontext.Context, stream, group, startstring) *StatusCmdXGroupSetID(ctxcontext.Context, stream, group, startstring) *StatusCmdXGroupDestroy(ctxcontext.Context, stream, groupstring) *IntCmdXGroupCreateConsumer(ctxcontext.Context, stream, group, consumerstring) *IntCmdXGroupDelConsumer(ctxcontext.Context, stream, group, consumerstring) *IntCmdXReadGroup(ctxcontext.Context, a *XReadGroupArgs) *XStreamSliceCmdXAck(ctxcontext.Context, stream, groupstring, ids ...string) *IntCmdXPending(ctxcontext.Context, stream, groupstring) *XPendingCmdXPendingExt(ctxcontext.Context, a *XPendingExtArgs) *XPendingExtCmdXClaim(ctxcontext.Context, a *XClaimArgs) *XMessageSliceCmdXClaimJustID(ctxcontext.Context, a *XClaimArgs) *StringSliceCmdXAutoClaim(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimCmdXAutoClaimJustID(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd// TODO: XTrim and XTrimApprox remove in v9.XTrim(ctxcontext.Context, keystring, maxLenint64) *IntCmdXTrimApprox(ctxcontext.Context, keystring, maxLenint64) *IntCmdXTrimMaxLen(ctxcontext.Context, keystring, maxLenint64) *IntCmdXTrimMaxLenApprox(ctxcontext.Context, keystring, maxLen, limitint64) *IntCmdXTrimMinID(ctxcontext.Context, keystring, minIDstring) *IntCmdXTrimMinIDApprox(ctxcontext.Context, keystring, minIDstring, limitint64) *IntCmdXInfoGroups(ctxcontext.Context, keystring) *XInfoGroupsCmdXInfoStream(ctxcontext.Context, keystring) *XInfoStreamCmdXInfoStreamFull(ctxcontext.Context, keystring, countint) *XInfoStreamFullCmdXInfoConsumers(ctxcontext.Context, keystring, groupstring) *XInfoConsumersCmdBZPopMax(ctxcontext.Context, timeouttime.Duration, keys ...string) *ZWithKeyCmdBZPopMin(ctxcontext.Context, timeouttime.Duration, keys ...string) *ZWithKeyCmdZAdd(ctxcontext.Context, keystring, members ...*Z) *IntCmdZAddNX(ctxcontext.Context, keystring, members ...*Z) *IntCmdZAddXX(ctxcontext.Context, keystring, members ...*Z) *IntCmdZAddCh(ctxcontext.Context, keystring, members ...*Z) *IntCmdZAddNXCh(ctxcontext.Context, keystring, members ...*Z) *IntCmdZAddXXCh(ctxcontext.Context, keystring, members ...*Z) *IntCmdZAddArgs(ctxcontext.Context, keystring, argsZAddArgs) *IntCmdZAddArgsIncr(ctxcontext.Context, keystring, argsZAddArgs) *FloatCmdZIncr(ctxcontext.Context, keystring, member *Z) *FloatCmdZIncrNX(ctxcontext.Context, keystring, member *Z) *FloatCmdZIncrXX(ctxcontext.Context, keystring, member *Z) *FloatCmdZCard(ctxcontext.Context, keystring) *IntCmdZCount(ctxcontext.Context, key, min, maxstring) *IntCmdZLexCount(ctxcontext.Context, key, min, maxstring) *IntCmdZIncrBy(ctxcontext.Context, keystring, incrementfloat64, memberstring) *FloatCmdZInter(ctxcontext.Context, store *ZStore) *StringSliceCmdZInterWithScores(ctxcontext.Context, store *ZStore) *ZSliceCmdZInterStore(ctxcontext.Context, destinationstring, store *ZStore) *IntCmdZMScore(ctxcontext.Context, keystring, members ...string) *FloatSliceCmdZPopMax(ctxcontext.Context, keystring, count ...int64) *ZSliceCmdZPopMin(ctxcontext.Context, keystring, count ...int64) *ZSliceCmdZRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmdZRangeWithScores(ctxcontext.Context, keystring, start, stopint64) *ZSliceCmdZRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmdZRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmdZRangeByScoreWithScores(ctxcontext.Context, keystring, opt *ZRangeBy) *ZSliceCmdZRangeArgs(ctxcontext.Context, zZRangeArgs) *StringSliceCmdZRangeArgsWithScores(ctxcontext.Context, zZRangeArgs) *ZSliceCmdZRangeStore(ctxcontext.Context, dststring, zZRangeArgs) *IntCmdZRank(ctxcontext.Context, key, memberstring) *IntCmdZRem(ctxcontext.Context, keystring, members ...interface{}) *IntCmdZRemRangeByRank(ctxcontext.Context, keystring, start, stopint64) *IntCmdZRemRangeByScore(ctxcontext.Context, key, min, maxstring) *IntCmdZRemRangeByLex(ctxcontext.Context, key, min, maxstring) *IntCmdZRevRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmdZRevRangeWithScores(ctxcontext.Context, keystring, start, stopint64) *ZSliceCmdZRevRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmdZRevRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmdZRevRangeByScoreWithScores(ctxcontext.Context, keystring, opt *ZRangeBy) *ZSliceCmdZRevRank(ctxcontext.Context, key, memberstring) *IntCmdZScore(ctxcontext.Context, key, memberstring) *FloatCmdZUnionStore(ctxcontext.Context, deststring, store *ZStore) *IntCmdZUnion(ctxcontext.Context, storeZStore) *StringSliceCmdZUnionWithScores(ctxcontext.Context, storeZStore) *ZSliceCmdZRandMember(ctxcontext.Context, keystring, countint, withScoresbool) *StringSliceCmdZDiff(ctxcontext.Context, keys ...string) *StringSliceCmdZDiffWithScores(ctxcontext.Context, keys ...string) *ZSliceCmdZDiffStore(ctxcontext.Context, destinationstring, keys ...string) *IntCmdPFAdd(ctxcontext.Context, keystring, els ...interface{}) *IntCmdPFCount(ctxcontext.Context, keys ...string) *IntCmdPFMerge(ctxcontext.Context, deststring, keys ...string) *StatusCmdBgRewriteAOF(ctxcontext.Context) *StatusCmdBgSave(ctxcontext.Context) *StatusCmdClientKill(ctxcontext.Context, ipPortstring) *StatusCmdClientKillByFilter(ctxcontext.Context, keys ...string) *IntCmdClientList(ctxcontext.Context) *StringCmdClientPause(ctxcontext.Context, durtime.Duration) *BoolCmdClientID(ctxcontext.Context) *IntCmdConfigGet(ctxcontext.Context, parameterstring) *SliceCmdConfigResetStat(ctxcontext.Context) *StatusCmdConfigSet(ctxcontext.Context, parameter, valuestring) *StatusCmdConfigRewrite(ctxcontext.Context) *StatusCmdDBSize(ctxcontext.Context) *IntCmdFlushAll(ctxcontext.Context) *StatusCmdFlushAllAsync(ctxcontext.Context) *StatusCmdFlushDB(ctxcontext.Context) *StatusCmdFlushDBAsync(ctxcontext.Context) *StatusCmdInfo(ctxcontext.Context, section ...string) *StringCmdLastSave(ctxcontext.Context) *IntCmdSave(ctxcontext.Context) *StatusCmdShutdown(ctxcontext.Context) *StatusCmdShutdownSave(ctxcontext.Context) *StatusCmdShutdownNoSave(ctxcontext.Context) *StatusCmdSlaveOf(ctxcontext.Context, host, portstring) *StatusCmdTime(ctxcontext.Context) *TimeCmdDebugObject(ctxcontext.Context, keystring) *StringCmdReadOnly(ctxcontext.Context) *StatusCmdReadWrite(ctxcontext.Context) *StatusCmdMemoryUsage(ctxcontext.Context, keystring, samples ...int) *IntCmdEval(ctxcontext.Context, scriptstring, keys []string, args ...interface{}) *CmdEvalSha(ctxcontext.Context, sha1string, keys []string, args ...interface{}) *CmdScriptExists(ctxcontext.Context, hashes ...string) *BoolSliceCmdScriptFlush(ctxcontext.Context) *StatusCmdScriptKill(ctxcontext.Context) *StatusCmdScriptLoad(ctxcontext.Context, scriptstring) *StringCmdPublish(ctxcontext.Context, channelstring, message interface{}) *IntCmdPubSubChannels(ctxcontext.Context, patternstring) *StringSliceCmdPubSubNumSub(ctxcontext.Context, channels ...string) *StringIntMapCmdPubSubNumPat(ctxcontext.Context) *IntCmdClusterSlots(ctxcontext.Context) *ClusterSlotsCmdClusterNodes(ctxcontext.Context) *StringCmdClusterMeet(ctxcontext.Context, host, portstring) *StatusCmdClusterForget(ctxcontext.Context, nodeIDstring) *StatusCmdClusterReplicate(ctxcontext.Context, nodeIDstring) *StatusCmdClusterResetSoft(ctxcontext.Context) *StatusCmdClusterResetHard(ctxcontext.Context) *StatusCmdClusterInfo(ctxcontext.Context) *StringCmdClusterKeySlot(ctxcontext.Context, keystring) *IntCmdClusterGetKeysInSlot(ctxcontext.Context, slotint, countint) *StringSliceCmdClusterCountFailureReports(ctxcontext.Context, nodeIDstring) *IntCmdClusterCountKeysInSlot(ctxcontext.Context, slotint) *IntCmdClusterDelSlots(ctxcontext.Context, slots ...int) *StatusCmdClusterDelSlotsRange(ctxcontext.Context, min, maxint) *StatusCmdClusterSaveConfig(ctxcontext.Context) *StatusCmdClusterSlaves(ctxcontext.Context, nodeIDstring) *StringSliceCmdClusterFailover(ctxcontext.Context) *StatusCmdClusterAddSlots(ctxcontext.Context, slots ...int) *StatusCmdClusterAddSlotsRange(ctxcontext.Context, min, maxint) *StatusCmdGeoAdd(ctxcontext.Context, keystring, geoLocation ...*GeoLocation) *IntCmdGeoPos(ctxcontext.Context, keystring, members ...string) *GeoPosCmdGeoRadius(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery) *GeoLocationCmdGeoRadiusStore(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery) *IntCmdGeoRadiusByMember(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery) *GeoLocationCmdGeoRadiusByMemberStore(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery) *IntCmdGeoSearch(ctxcontext.Context, keystring, q *GeoSearchQuery) *StringSliceCmdGeoSearchLocation(ctxcontext.Context, keystring, q *GeoSearchLocationQuery) *GeoSearchLocationCmdGeoSearchStore(ctxcontext.Context, key, storestring, q *GeoSearchStoreQuery) *IntCmdGeoDist(ctxcontext.Context, keystring, member1, member2, unitstring) *FloatCmdGeoHash(ctxcontext.Context, keystring, members ...string) *StringSliceCmd}typeCommandInfo¶
typeCommandsInfoCmd¶
type CommandsInfoCmd struct {// contains filtered or unexported fields}funcNewCommandsInfoCmd¶
func NewCommandsInfoCmd(ctxcontext.Context, args ...interface{}) *CommandsInfoCmd
funcNewCommandsInfoCmdResult¶
func NewCommandsInfoCmdResult(val map[string]*CommandInfo, errerror) *CommandsInfoCmd
NewCommandsInfoCmdResult returns a CommandsInfoCmd initialised with val and err for testing.
func (*CommandsInfoCmd)Result¶
func (cmd *CommandsInfoCmd) Result() (map[string]*CommandInfo,error)
func (*CommandsInfoCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *CommandsInfoCmd) SetFirstKeyPos(keyPosint8)
func (*CommandsInfoCmd)SetVal¶added inv8.11.4
func (cmd *CommandsInfoCmd) SetVal(val map[string]*CommandInfo)
func (*CommandsInfoCmd)String¶
func (cmd *CommandsInfoCmd) String()string
func (*CommandsInfoCmd)Val¶
func (cmd *CommandsInfoCmd) Val() map[string]*CommandInfo
typeConn¶
type Conn struct {// contains filtered or unexported fields}Conn represents a single Redis connection rather than a pool of connections.Prefer running commands from Client unless there is a specific needfor a continuous single Redis connection.
Example¶
conn := rdb.Conn(context.Background())err := conn.ClientSetName(ctx, "foobar").Err()if err != nil {panic(err)}// Open other connections.for i := 0; i < 10; i++ {go rdb.Ping(ctx)}s, err := conn.ClientGetName(ctx).Result()if err != nil {panic(err)}fmt.Println(s)Output:foobar
func (*Conn)TxPipeline¶
TxPipeline acts like Pipeline, but wraps queued commands with MULTI/EXEC.
typeConsistentHash¶
typeDurationCmd¶
type DurationCmd struct {// contains filtered or unexported fields}funcNewDurationCmd¶
func NewDurationCmd(ctxcontext.Context, precisiontime.Duration, args ...interface{}) *DurationCmd
funcNewDurationResult¶
func NewDurationResult(valtime.Duration, errerror) *DurationCmd
NewDurationResult returns a DurationCmd initialised with val and err for testing.
func (*DurationCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *DurationCmd) SetFirstKeyPos(keyPosint8)
func (*DurationCmd)SetVal¶added inv8.11.4
func (cmd *DurationCmd) SetVal(valtime.Duration)
func (*DurationCmd)String¶
func (cmd *DurationCmd) String()string
func (*DurationCmd)Val¶
func (cmd *DurationCmd) Val()time.Duration
typeError¶
type Error interface {error// RedisError is a no-op function but// serves to distinguish types that are Redis// errors from ordinary errors: a type is a// Redis error if it has a RedisError method.RedisError()}typeFailoverOptions¶
type FailoverOptions struct {// The master name.MasterNamestring// A seed list of host:port addresses of sentinel nodes.SentinelAddrs []string// If specified with SentinelPassword, enables ACL-based authentication (via// AUTH <user> <pass>).SentinelUsernamestring// Sentinel password from "requirepass <password>" (if enabled) in Sentinel// configuration, or, if SentinelUsername is also supplied, used for ACL-based// authentication.SentinelPasswordstring// Allows routing read-only commands to the closest master or slave node.// This option only works with NewFailoverClusterClient.RouteByLatencybool// Allows routing read-only commands to the random master or slave node.// This option only works with NewFailoverClusterClient.RouteRandomlybool// Route all commands to slave read-only nodes.SlaveOnlybool// Use slaves disconnected with master when cannot get connected slaves// Now, this option only works in RandomSlaveAddr function.UseDisconnectedSlavesboolDialer func(ctxcontext.Context, network, addrstring) (net.Conn,error)OnConnect func(ctxcontext.Context, cn *Conn)errorUsernamestringPasswordstringDBintMaxRetriesintMinRetryBackofftime.DurationMaxRetryBackofftime.DurationDialTimeouttime.DurationReadTimeouttime.DurationWriteTimeouttime.Duration// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).PoolFIFOboolPoolSizeintMinIdleConnsintMaxConnAgetime.DurationPoolTimeouttime.DurationIdleTimeouttime.DurationIdleCheckFrequencytime.DurationTLSConfig *tls.Config}FailoverOptions are used to configure a failover client and shouldbe passed to NewFailoverClient.
typeFloatCmd¶
type FloatCmd struct {// contains filtered or unexported fields}funcNewFloatCmd¶
funcNewFloatResult¶
NewFloatResult returns a FloatCmd initialised with val and err for testing.
func (*FloatCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *FloatCmd) SetFirstKeyPos(keyPosint8)
typeFloatSliceCmd¶added inv8.8.0
type FloatSliceCmd struct {// contains filtered or unexported fields}funcNewFloatSliceCmd¶added inv8.8.0
func NewFloatSliceCmd(ctxcontext.Context, args ...interface{}) *FloatSliceCmd
func (*FloatSliceCmd)Result¶added inv8.8.0
func (cmd *FloatSliceCmd) Result() ([]float64,error)
func (*FloatSliceCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *FloatSliceCmd) SetFirstKeyPos(keyPosint8)
func (*FloatSliceCmd)SetVal¶added inv8.11.4
func (cmd *FloatSliceCmd) SetVal(val []float64)
func (*FloatSliceCmd)String¶added inv8.8.0
func (cmd *FloatSliceCmd) String()string
func (*FloatSliceCmd)Val¶added inv8.8.0
func (cmd *FloatSliceCmd) Val() []float64
typeGeoLocation¶
GeoLocation is used with GeoAdd to add geospatial location.
typeGeoLocationCmd¶
type GeoLocationCmd struct {// contains filtered or unexported fields}funcNewGeoLocationCmd¶
func NewGeoLocationCmd(ctxcontext.Context, q *GeoRadiusQuery, args ...interface{}) *GeoLocationCmd
funcNewGeoLocationCmdResult¶
func NewGeoLocationCmdResult(val []GeoLocation, errerror) *GeoLocationCmd
NewGeoLocationCmdResult returns a GeoLocationCmd initialised with val and err for testing.
func (*GeoLocationCmd)Result¶
func (cmd *GeoLocationCmd) Result() ([]GeoLocation,error)
func (*GeoLocationCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *GeoLocationCmd) SetFirstKeyPos(keyPosint8)
func (*GeoLocationCmd)SetVal¶added inv8.11.4
func (cmd *GeoLocationCmd) SetVal(locations []GeoLocation)
func (*GeoLocationCmd)String¶
func (cmd *GeoLocationCmd) String()string
func (*GeoLocationCmd)Val¶
func (cmd *GeoLocationCmd) Val() []GeoLocation
typeGeoPosCmd¶
type GeoPosCmd struct {// contains filtered or unexported fields}funcNewGeoPosCmd¶
funcNewGeoPosCmdResult¶
NewGeoPosCmdResult returns a GeoPosCmd initialised with val and err for testing.
func (*GeoPosCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *GeoPosCmd) SetFirstKeyPos(keyPosint8)
typeGeoRadiusQuery¶
type GeoRadiusQuery struct {Radiusfloat64// Can be m, km, ft, or mi. Default is km.UnitstringWithCoordboolWithDistboolWithGeoHashboolCountint// Can be ASC or DESC. Default is no sort order.SortstringStorestringStoreDiststring}GeoRadiusQuery is used with GeoRadius to query geospatial index.
typeGeoSearchLocationCmd¶added inv8.11.1
type GeoSearchLocationCmd struct {// contains filtered or unexported fields}funcNewGeoSearchLocationCmd¶added inv8.11.1
func NewGeoSearchLocationCmd(ctxcontext.Context, opt *GeoSearchLocationQuery, args ...interface{},) *GeoSearchLocationCmd
func (*GeoSearchLocationCmd)Args¶added inv8.11.1
func (cmd *GeoSearchLocationCmd) Args() []interface{}func (*GeoSearchLocationCmd)FullName¶added inv8.11.1
func (cmd *GeoSearchLocationCmd) FullName()string
func (*GeoSearchLocationCmd)Result¶added inv8.11.1
func (cmd *GeoSearchLocationCmd) Result() ([]GeoLocation,error)
func (*GeoSearchLocationCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *GeoSearchLocationCmd) SetFirstKeyPos(keyPosint8)
func (*GeoSearchLocationCmd)SetVal¶added inv8.11.4
func (cmd *GeoSearchLocationCmd) SetVal(val []GeoLocation)
func (*GeoSearchLocationCmd)String¶added inv8.11.1
func (cmd *GeoSearchLocationCmd) String()string
func (*GeoSearchLocationCmd)Val¶added inv8.11.1
func (cmd *GeoSearchLocationCmd) Val() []GeoLocation
typeGeoSearchLocationQuery¶added inv8.11.1
type GeoSearchLocationQuery struct {GeoSearchQueryWithCoordboolWithDistboolWithHashbool}typeGeoSearchQuery¶added inv8.11.1
type GeoSearchQuery struct {Memberstring// Latitude and Longitude when using FromLonLat option.Longitudefloat64Latitudefloat64// Distance and unit when using ByRadius option.// Can use m, km, ft, or mi. Default is km.Radiusfloat64RadiusUnitstring// Height, width and unit when using ByBox option.// Can be m, km, ft, or mi. Default is km.BoxWidthfloat64BoxHeightfloat64BoxUnitstring// Can be ASC or DESC. Default is no sort order.SortstringCountintCountAnybool}GeoSearchQuery is used for GEOSearch/GEOSearchStore command query.
typeGeoSearchStoreQuery¶added inv8.11.1
type GeoSearchStoreQuery struct {GeoSearchQuery// When using the StoreDist option, the command stores the items in a// sorted set populated with their distance from the center of the circle or box,// as a floating-point number, in the same unit specified for that shape.StoreDistbool}typeIntCmd¶
type IntCmd struct {// contains filtered or unexported fields}funcNewIntResult¶
NewIntResult returns an IntCmd initialised with val and err for testing.
func (*IntCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *IntCmd) SetFirstKeyPos(keyPosint8)
typeIntSliceCmd¶
type IntSliceCmd struct {// contains filtered or unexported fields}funcNewIntSliceCmd¶
func NewIntSliceCmd(ctxcontext.Context, args ...interface{}) *IntSliceCmd
func (*IntSliceCmd)Result¶
func (cmd *IntSliceCmd) Result() ([]int64,error)
func (*IntSliceCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *IntSliceCmd) SetFirstKeyPos(keyPosint8)
func (*IntSliceCmd)SetVal¶added inv8.11.4
func (cmd *IntSliceCmd) SetVal(val []int64)
func (*IntSliceCmd)String¶
func (cmd *IntSliceCmd) String()string
func (*IntSliceCmd)Val¶
func (cmd *IntSliceCmd) Val() []int64
typeLimiter¶
type Limiter interface {// Allow returns nil if operation is allowed or an error otherwise.// If operation is allowed client must ReportResult of the operation// whether it is a success or a failure.Allow()error// ReportResult reports the result of the previously allowed operation.// nil indicates a success, non-nil error usually indicates a failure.ReportResult(resulterror)}Limiter is the interface of a rate limiter or a circuit breaker.
typeOptions¶
type Options struct {// The network type, either tcp or unix.// Default is tcp.Networkstring// host:port address.Addrstring// Dialer creates new network connection and has priority over// Network and Addr options.Dialer func(ctxcontext.Context, network, addrstring) (net.Conn,error)// Hook that is called when new connection is established.OnConnect func(ctxcontext.Context, cn *Conn)error// Use the specified Username to authenticate the current connection// with one of the connections defined in the ACL list when connecting// to a Redis 6.0 instance, or greater, that is using the Redis ACL system.Usernamestring// Optional password. Must match the password specified in the// requirepass server configuration option (if connecting to a Redis 5.0 instance, or lower),// or the User Password when connecting to a Redis 6.0 instance, or greater,// that is using the Redis ACL system.Passwordstring// Database to be selected after connecting to the server.DBint// Maximum number of retries before giving up.// Default is 3 retries; -1 (not 0) disables retries.MaxRetriesint// Minimum backoff between each retry.// Default is 8 milliseconds; -1 disables backoff.MinRetryBackofftime.Duration// Maximum backoff between each retry.// Default is 512 milliseconds; -1 disables backoff.MaxRetryBackofftime.Duration// Dial timeout for establishing new connections.// Default is 5 seconds.DialTimeouttime.Duration// Timeout for socket reads. If reached, commands will fail// with a timeout instead of blocking. Use value -1 for no timeout and 0 for default.// Default is 3 seconds.ReadTimeouttime.Duration// Timeout for socket writes. If reached, commands will fail// with a timeout instead of blocking.// Default is ReadTimeout.WriteTimeouttime.Duration// Type of connection pool.// true for FIFO pool, false for LIFO pool.// Note that fifo has higher overhead compared to lifo.PoolFIFObool// Maximum number of socket connections.// Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.PoolSizeint// Minimum number of idle connections which is useful when establishing// new connection is slow.MinIdleConnsint// Connection age at which client retires (closes) the connection.// Default is to not close aged connections.MaxConnAgetime.Duration// Amount of time client waits for connection if all connections// are busy before returning an error.// Default is ReadTimeout + 1 second.PoolTimeouttime.Duration// Amount of time after which client closes idle connections.// Should be less than server's timeout.// Default is 5 minutes. -1 disables idle timeout check.IdleTimeouttime.Duration// Frequency of idle checks made by idle connections reaper.// Default is 1 minute. -1 disables idle connections reaper,// but idle connections are still discarded by the client// if IdleTimeout is set.IdleCheckFrequencytime.Duration// TLS Config to use. When set TLS will be negotiated.TLSConfig *tls.Config// Limiter interface used to implemented circuit breaker or rate limiter.LimiterLimiter// contains filtered or unexported fields}Options keeps the settings to setup redis connection.
funcParseURL¶
ParseURL parses an URL into Options that can be used to connect to Redis.Scheme is required.There are two connection types: by tcp socket and by unix socket.Tcp connection:
redis://<user>:<password>@<host>:<port>/<db_number>
Unix connection:
unix://<user>:<password>@</path/to/redis.sock>?db=<db_number>
Most Option fields can be set using query parameters, with the following restrictions:
- field names are mapped using snake-case conversion: to set MaxRetries, use max_retries
- only scalar type fields are supported (bool, int, time.Duration)
- for time.Duration fields, values must be a valid input for time.ParseDuration();additionally a plain integer as value (i.e. without unit) is intepreted as seconds
- to disable a duration field, use value less than or equal to 0; to use the defaultvalue, leave the value blank or remove the parameter
- only the last value is interpreted if a parameter is given multiple times
- fields "network", "addr", "username" and "password" can only be set using otherURL attributes (scheme, host, userinfo, resp.), query paremeters using thesenames will be treated as unknown parameters
- unknown parameter names will result in an error
Examples:
redis://user:password@localhost:6789/3?dial_timeout=3&db=1&read_timeout=6s&max_retries=2is equivalent to:&Options{Network: "tcp",Addr: "localhost:6789",DB: 1, // path "/3" was overridden by "&db=1"DialTimeout: 3 * time.Second, // no time unit = secondsReadTimeout: 6 * time.Second,MaxRetries: 2,}Example¶
opt, err := redis.ParseURL("redis://:qwerty@localhost:6379/1?dial_timeout=5s")if err != nil {panic(err)}fmt.Println("addr is", opt.Addr)fmt.Println("db is", opt.DB)fmt.Println("password is", opt.Password)fmt.Println("dial timeout is", opt.DialTimeout)// Create client as usually._ = redis.NewClient(opt)Output:addr is localhost:6379db is 1password is qwertydial timeout is 5s
typePipeline¶
type Pipeline struct {// contains filtered or unexported fields}Pipeline implements pipelining as described inhttp://redis.io/topics/pipelining. It's safe for concurrent useby multiple goroutines.
Example (Instrumentation)¶
rdb := redis.NewClient(&redis.Options{Addr: ":6379",})rdb.AddHook(redisHook{})rdb.Pipelined(ctx, func(pipe redis.Pipeliner) error {pipe.Ping(ctx)pipe.Ping(ctx)return nil})Output:pipeline starting processing: [ping: ping: ]pipeline finished processing: [ping: PONG ping: PONG]
func (Pipeline)AuthACL¶
AuthACL Perform an AUTH command, using the given user and pass.Should be used to authenticate the current connection with one of the connections defined in the ACL listwhen connecting to a Redis 6.0 instance, or greater, that is using the Redis ACL system.
func (Pipeline)BRPopLPush¶
func (Pipeline)BgRewriteAOF¶
func (Pipeline)BitField¶
func (c Pipeline) BitField(ctxcontext.Context, keystring, args ...interface{}) *IntSliceCmd
func (Pipeline)ClientGetName¶
ClientGetName returns the name of the connection.
func (Pipeline)ClientKillByFilter¶
ClientKillByFilter is new style syntax, while the ClientKill is old
CLIENT KILL <option> [value] ... <option> [value]
func (Pipeline)ClientList¶
func (Pipeline)ClientPause¶
func (Pipeline)ClientSetName¶
ClientSetName assigns a name to the connection.
func (Pipeline)ClientUnblockWithError¶
func (Pipeline)ClusterAddSlots¶
func (Pipeline)ClusterAddSlotsRange¶
func (Pipeline)ClusterCountFailureReports¶
func (Pipeline)ClusterCountKeysInSlot¶
func (Pipeline)ClusterDelSlots¶
func (Pipeline)ClusterDelSlotsRange¶
func (Pipeline)ClusterFailover¶
func (Pipeline)ClusterForget¶
func (Pipeline)ClusterGetKeysInSlot¶
func (c Pipeline) ClusterGetKeysInSlot(ctxcontext.Context, slotint, countint) *StringSliceCmd
func (Pipeline)ClusterInfo¶
func (Pipeline)ClusterKeySlot¶
func (Pipeline)ClusterMeet¶
func (Pipeline)ClusterNodes¶
func (Pipeline)ClusterReplicate¶
func (Pipeline)ClusterResetHard¶
func (Pipeline)ClusterResetSoft¶
func (Pipeline)ClusterSaveConfig¶
func (Pipeline)ClusterSlaves¶
func (c Pipeline) ClusterSlaves(ctxcontext.Context, nodeIDstring) *StringSliceCmd
func (Pipeline)ClusterSlots¶
func (c Pipeline) ClusterSlots(ctxcontext.Context) *ClusterSlotsCmd
func (Pipeline)Command¶
func (c Pipeline) Command(ctxcontext.Context) *CommandsInfoCmd
func (Pipeline)ConfigResetStat¶
func (Pipeline)ConfigRewrite¶
func (*Pipeline)Exec¶
Exec executes all previously queued commands using oneclient-server roundtrip.
Exec always returns list of commands and error of the first failedcommand if any.
func (Pipeline)FlushAllAsync¶
func (Pipeline)FlushDBAsync¶
func (Pipeline)GeoAdd¶
func (c Pipeline) GeoAdd(ctxcontext.Context, keystring, geoLocation ...*GeoLocation) *IntCmd
func (Pipeline)GeoHash¶
func (c Pipeline) GeoHash(ctxcontext.Context, keystring, members ...string) *StringSliceCmd
func (Pipeline)GeoRadius¶
func (c Pipeline) GeoRadius(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery,) *GeoLocationCmd
GeoRadius is a read-only GEORADIUS_RO command.
func (Pipeline)GeoRadiusByMember¶
func (c Pipeline) GeoRadiusByMember(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery,) *GeoLocationCmd
GeoRadiusByMember is a read-only GEORADIUSBYMEMBER_RO command.
func (Pipeline)GeoRadiusByMemberStore¶
func (c Pipeline) GeoRadiusByMemberStore(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery,) *IntCmd
GeoRadiusByMemberStore is a writing GEORADIUSBYMEMBER command.
func (Pipeline)GeoRadiusStore¶
func (c Pipeline) GeoRadiusStore(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery,) *IntCmd
GeoRadiusStore is a writing GEORADIUS command.
func (Pipeline)GeoSearch¶added inv8.11.1
func (c Pipeline) GeoSearch(ctxcontext.Context, keystring, q *GeoSearchQuery) *StringSliceCmd
func (Pipeline)GeoSearchLocation¶added inv8.11.1
func (c Pipeline) GeoSearchLocation(ctxcontext.Context, keystring, q *GeoSearchLocationQuery,) *GeoSearchLocationCmd
func (Pipeline)GeoSearchStore¶added inv8.11.1
func (c Pipeline) GeoSearchStore(ctxcontext.Context, key, storestring, q *GeoSearchStoreQuery) *IntCmd
func (Pipeline)GetEx¶added inv8.8.1
GetEx An expiration of zero removes the TTL associated with the key (i.e. GETEX key persist).Requires Redis >= 6.2.0.
func (Pipeline)HIncrByFloat¶
func (Pipeline)HMGet¶
HMGet returns the values for the specified fields in the hash stored at key.It returns an interface{} to distinguish between empty string and nil value.
func (Pipeline)HRandField¶added inv8.8.1
func (c Pipeline) HRandField(ctxcontext.Context, keystring, countint, withValuesbool) *StringSliceCmd
HRandField redis-server version >= 6.2.0.
func (Pipeline)HSet¶
HSet accepts values in following formats:
- HSet("myhash", "key1", "value1", "key2", "value2")
- HSet("myhash", []string{"key1", "value1", "key2", "value2"})
- HSet("myhash", map[string]interface{}{"key1": "value1", "key2": "value2"})
Note that it requires Redis v4 for multiple field/value pairs support.
func (Pipeline)IncrByFloat¶
func (Pipeline)LInsertAfter¶
func (Pipeline)LInsertBefore¶
func (Pipeline)LPopCount¶added inv8.8.3
func (c Pipeline) LPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmd
func (Pipeline)LRange¶
func (c Pipeline) LRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (Pipeline)MSet¶
MSet is like Set but accepts multiple values:
- MSet("key1", "value1", "key2", "value2")
- MSet([]string{"key1", "value1", "key2", "value2"})
- MSet(map[string]interface{}{"key1": "value1", "key2": "value2"})
func (Pipeline)MSetNX¶
MSetNX is like SetNX but accepts multiple values:
- MSetNX("key1", "value1", "key2", "value2")
- MSetNX([]string{"key1", "value1", "key2", "value2"})
- MSetNX(map[string]interface{}{"key1": "value1", "key2": "value2"})
func (Pipeline)MemoryUsage¶
func (Pipeline)ObjectEncoding¶
func (Pipeline)ObjectIdleTime¶
func (c Pipeline) ObjectIdleTime(ctxcontext.Context, keystring) *DurationCmd
func (Pipeline)ObjectRefCount¶
func (Pipeline)PubSubChannels¶
func (c Pipeline) PubSubChannels(ctxcontext.Context, patternstring) *StringSliceCmd
func (Pipeline)PubSubNumPat¶
func (Pipeline)PubSubNumSub¶
func (c Pipeline) PubSubNumSub(ctxcontext.Context, channels ...string) *StringIntMapCmd
func (Pipeline)RPopCount¶added inv8.11.1
func (c Pipeline) RPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmd
func (Pipeline)RestoreReplace¶
func (Pipeline)SDiffStore¶
func (Pipeline)SInterStore¶
func (Pipeline)SMIsMember¶added inv8.8.3
func (c Pipeline) SMIsMember(ctxcontext.Context, keystring, members ...interface{}) *BoolSliceCmd
SMIsMember Redis `SMISMEMBER key member [member ...]` command.
func (Pipeline)SMembers¶
func (c Pipeline) SMembers(ctxcontext.Context, keystring) *StringSliceCmd
SMembers Redis `SMEMBERS key` command output as a slice.
func (Pipeline)SMembersMap¶
func (c Pipeline) SMembersMap(ctxcontext.Context, keystring) *StringStructMapCmd
SMembersMap Redis `SMEMBERS key` command output as a map.
func (Pipeline)SPopN¶
func (c Pipeline) SPopN(ctxcontext.Context, keystring, countint64) *StringSliceCmd
SPopN Redis `SPOP key count` command.
func (Pipeline)SRandMember¶
SRandMember Redis `SRANDMEMBER key` command.
func (Pipeline)SRandMemberN¶
func (c Pipeline) SRandMemberN(ctxcontext.Context, keystring, countint64) *StringSliceCmd
SRandMemberN Redis `SRANDMEMBER key count` command.
func (Pipeline)SUnionStore¶
func (Pipeline)ScriptExists¶
func (c Pipeline) ScriptExists(ctxcontext.Context, hashes ...string) *BoolSliceCmd
func (Pipeline)ScriptFlush¶
func (Pipeline)ScriptKill¶
func (Pipeline)Set¶
func (c Pipeline) Set(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmd
Set Redis `SET key value [expiration]` command.Use expiration for `SETEX`-like behavior.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (Pipeline)SetArgs¶added inv8.6.0
SetArgs supports all the options that the SET command supports.It is the alternative to the Set function when you wantto have more control over the options.
func (Pipeline)SetEX¶added inv8.3.3
func (c Pipeline) SetEX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmd
SetEX Redis `SETEX key expiration value` command.
func (Pipeline)SetNX¶
func (c Pipeline) SetNX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmd
SetNX Redis `SET key value [expiration] NX` command.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (Pipeline)SetXX¶
func (c Pipeline) SetXX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmd
SetXX Redis `SET key value [expiration] XX` command.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (Pipeline)ShutdownNoSave¶
func (Pipeline)ShutdownSave¶
func (Pipeline)SlowLogGet¶
func (c Pipeline) SlowLogGet(ctxcontext.Context, numint64) *SlowLogCmd
func (Pipeline)Sort¶
func (c Pipeline) Sort(ctxcontext.Context, keystring, sort *Sort) *StringSliceCmd
func (Pipeline)SortInterfaces¶
func (*Pipeline)TxPipeline¶
func (*Pipeline)TxPipelined¶
func (Pipeline)XAdd¶
XAdd a.Limit has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046
func (Pipeline)XAutoClaim¶added inv8.11.0
func (c Pipeline) XAutoClaim(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimCmd
func (Pipeline)XAutoClaimJustID¶added inv8.11.0
func (c Pipeline) XAutoClaimJustID(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd
func (Pipeline)XClaim¶
func (c Pipeline) XClaim(ctxcontext.Context, a *XClaimArgs) *XMessageSliceCmd
func (Pipeline)XClaimJustID¶
func (c Pipeline) XClaimJustID(ctxcontext.Context, a *XClaimArgs) *StringSliceCmd
func (Pipeline)XGroupCreate¶
func (Pipeline)XGroupCreateConsumer¶added inv8.11.0
func (Pipeline)XGroupCreateMkStream¶
func (Pipeline)XGroupDelConsumer¶
func (Pipeline)XGroupDestroy¶
func (Pipeline)XGroupSetID¶
func (Pipeline)XInfoConsumers¶added inv8.6.0
func (c Pipeline) XInfoConsumers(ctxcontext.Context, keystring, groupstring) *XInfoConsumersCmd
func (Pipeline)XInfoGroups¶
func (c Pipeline) XInfoGroups(ctxcontext.Context, keystring) *XInfoGroupsCmd
func (Pipeline)XInfoStream¶added inv8.2.1
func (c Pipeline) XInfoStream(ctxcontext.Context, keystring) *XInfoStreamCmd
func (Pipeline)XInfoStreamFull¶added inv8.9.0
func (c Pipeline) XInfoStreamFull(ctxcontext.Context, keystring, countint) *XInfoStreamFullCmd
XInfoStreamFull XINFO STREAM FULL [COUNT count]redis-server >= 6.0.
func (Pipeline)XPending¶
func (c Pipeline) XPending(ctxcontext.Context, stream, groupstring) *XPendingCmd
func (Pipeline)XPendingExt¶
func (c Pipeline) XPendingExt(ctxcontext.Context, a *XPendingExtArgs) *XPendingExtCmd
func (Pipeline)XRange¶
func (c Pipeline) XRange(ctxcontext.Context, stream, start, stopstring) *XMessageSliceCmd
func (Pipeline)XRangeN¶
func (c Pipeline) XRangeN(ctxcontext.Context, stream, start, stopstring, countint64) *XMessageSliceCmd
func (Pipeline)XReadGroup¶
func (c Pipeline) XReadGroup(ctxcontext.Context, a *XReadGroupArgs) *XStreamSliceCmd
func (Pipeline)XReadStreams¶
func (c Pipeline) XReadStreams(ctxcontext.Context, streams ...string) *XStreamSliceCmd
func (Pipeline)XRevRange¶
func (c Pipeline) XRevRange(ctxcontext.Context, stream, start, stopstring) *XMessageSliceCmd
func (Pipeline)XRevRangeN¶
func (c Pipeline) XRevRangeN(ctxcontext.Context, stream, start, stopstring, countint64) *XMessageSliceCmd
func (Pipeline)XTrimMaxLen¶added inv8.11.0
XTrimMaxLen No `~` rules are used, `limit` cannot be used.cmd: XTRIM key MAXLEN maxLen
func (Pipeline)XTrimMaxLenApprox¶added inv8.11.0
XTrimMaxLenApprox LIMIT has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046cmd: XTRIM key MAXLEN ~ maxLen LIMIT limit
func (Pipeline)XTrimMinID¶added inv8.11.0
XTrimMinID No `~` rules are used, `limit` cannot be used.cmd: XTRIM key MINID minID
func (Pipeline)XTrimMinIDApprox¶added inv8.11.0
XTrimMinIDApprox LIMIT has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046cmd: XTRIM key MINID ~ minID LIMIT limit
func (Pipeline)ZAddArgsIncr¶added inv8.11.0
func (Pipeline)ZAddCh¶
ZAddCh Redis `ZADD key CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{Ch: true,Members: []Z,})remove in v9.func (Pipeline)ZAddNXCh¶
ZAddNXCh Redis `ZADD key NX CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{NX: true,Ch: true,Members: []Z,})remove in v9.func (Pipeline)ZAddXXCh¶
ZAddXXCh Redis `ZADD key XX CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{XX: true,Ch: true,Members: []Z,})remove in v9.func (Pipeline)ZDiff¶added inv8.9.0
func (c Pipeline) ZDiff(ctxcontext.Context, keys ...string) *StringSliceCmd
ZDiff redis-server version >= 6.2.0.
func (Pipeline)ZDiffStore¶added inv8.10.0
ZDiffStore redis-server version >=6.2.0.
func (Pipeline)ZDiffWithScores¶added inv8.9.0
ZDiffWithScores redis-server version >= 6.2.0.
func (Pipeline)ZIncr¶
ZIncr Redis `ZADD key INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{Members: []Z,})remove in v9.func (Pipeline)ZIncrNX¶
ZIncrNX Redis `ZADD key NX INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{NX: true,Members: []Z,})remove in v9.func (Pipeline)ZIncrXX¶
ZIncrXX Redis `ZADD key XX INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{XX: true,Members: []Z,})remove in v9.func (Pipeline)ZInter¶added inv8.10.0
func (c Pipeline) ZInter(ctxcontext.Context, store *ZStore) *StringSliceCmd
func (Pipeline)ZInterStore¶
func (Pipeline)ZInterWithScores¶added inv8.10.0
func (Pipeline)ZMScore¶added inv8.8.0
func (c Pipeline) ZMScore(ctxcontext.Context, keystring, members ...string) *FloatSliceCmd
func (Pipeline)ZRandMember¶added inv8.8.1
func (c Pipeline) ZRandMember(ctxcontext.Context, keystring, countint, withScoresbool) *StringSliceCmd
ZRandMember redis-server version >= 6.2.0.
func (Pipeline)ZRange¶
func (c Pipeline) ZRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (Pipeline)ZRangeArgs¶added inv8.11.0
func (c Pipeline) ZRangeArgs(ctxcontext.Context, zZRangeArgs) *StringSliceCmd
func (Pipeline)ZRangeArgsWithScores¶added inv8.11.0
func (c Pipeline) ZRangeArgsWithScores(ctxcontext.Context, zZRangeArgs) *ZSliceCmd
func (Pipeline)ZRangeByLex¶
func (c Pipeline) ZRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Pipeline)ZRangeByScore¶
func (c Pipeline) ZRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Pipeline)ZRangeByScoreWithScores¶
func (Pipeline)ZRangeStore¶added inv8.11.0
func (c Pipeline) ZRangeStore(ctxcontext.Context, dststring, zZRangeArgs) *IntCmd
func (Pipeline)ZRangeWithScores¶
func (Pipeline)ZRemRangeByLex¶
func (Pipeline)ZRemRangeByRank¶
func (Pipeline)ZRemRangeByScore¶
func (Pipeline)ZRevRange¶
func (c Pipeline) ZRevRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (Pipeline)ZRevRangeByLex¶
func (c Pipeline) ZRevRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Pipeline)ZRevRangeByScore¶
func (c Pipeline) ZRevRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Pipeline)ZRevRangeByScoreWithScores¶
func (Pipeline)ZRevRangeWithScores¶
func (Pipeline)ZUnion¶added inv8.11.0
func (c Pipeline) ZUnion(ctxcontext.Context, storeZStore) *StringSliceCmd
func (Pipeline)ZUnionStore¶
typePipeliner¶
type Pipeliner interface {StatefulCmdableLen()intDo(ctxcontext.Context, args ...interface{}) *CmdProcess(ctxcontext.Context, cmdCmder)errorClose()errorDiscard()errorExec(ctxcontext.Context) ([]Cmder,error)}Pipeliner is an mechanism to realise Redis Pipeline technique.
Pipelining is a technique to extremely speed up processing by packingoperations to batches, send them at once to Redis and read a replies in asinge step.Seehttps://redis.io/topics/pipelining
Pay attention, that Pipeline is not a transaction, so you can get unexpectedresults in case of big pipelines and small read/write timeouts.Redis client has retransmission logic in case of timeouts, pipelinecan be retransmitted and commands can be executed more then once.To avoid this: it is good idea to use reasonable bigger read/write timeoutsdepends of your batch size and/or use TxPipeline.
typePong¶
type Pong struct {Payloadstring}Pong received as result of a PING command issued by another client.
typePubSub¶
type PubSub struct {// contains filtered or unexported fields}PubSub implements Pub/Sub commands as described inhttp://redis.io/topics/pubsub. Message receiving is NOT safefor concurrent use by multiple goroutines.
PubSub automatically reconnects to Redis Server and resubscribesto the channels in case of network errors.
Example¶
pubsub := rdb.Subscribe(ctx, "mychannel1")// Wait for confirmation that subscription is created before publishing anything._, err := pubsub.Receive(ctx)if err != nil {panic(err)}// Go channel which receives messages.ch := pubsub.Channel()// Publish a message.err = rdb.Publish(ctx, "mychannel1", "hello").Err()if err != nil {panic(err)}time.AfterFunc(time.Second, func() {// When pubsub is closed channel is closed too._ = pubsub.Close()})// Consume messages.for msg := range ch {fmt.Println(msg.Channel, msg.Payload)}Output:mychannel1 hello
func (*PubSub)Channel¶
func (c *PubSub) Channel(opts ...ChannelOption) <-chan *Message
Channel returns a Go channel for concurrently receiving messages.The channel is closed together with the PubSub. If the Go channelis blocked full for 30 seconds the message is dropped.Receive* APIs can not be used after channel is created.
go-redis periodically sends ping messages to test connection healthand re-subscribes if ping can not not received for 30 seconds.
func (*PubSub)ChannelSizedeprecated
func (*PubSub)ChannelWithSubscriptions¶
ChannelWithSubscriptions is like Channel, but message type can be either*Subscription or *Message. Subscription messages can be used to detectreconnections.
ChannelWithSubscriptions can not be used together with Channel or ChannelSize.
func (*PubSub)PSubscribe¶
PSubscribe the client to the given patterns. It returnsempty subscription if there are no patterns.
func (*PubSub)PUnsubscribe¶
PUnsubscribe the client from the given patterns, or from all ofthem if none is given.
func (*PubSub)Receive¶
Receive returns a message as a Subscription, Message, Pong or error.See PubSub example for details. This is low-level API and in most casesChannel should be used instead.
Example¶
pubsub := rdb.Subscribe(ctx, "mychannel2")defer pubsub.Close()for i := 0; i < 2; i++ {// ReceiveTimeout is a low level API. Use ReceiveMessage instead.msgi, err := pubsub.ReceiveTimeout(ctx, time.Second)if err != nil {break}switch msg := msgi.(type) {case *redis.Subscription:fmt.Println("subscribed to", msg.Channel)_, err := rdb.Publish(ctx, "mychannel2", "hello").Result()if err != nil {panic(err)}case *redis.Message:fmt.Println("received", msg.Payload, "from", msg.Channel)default:panic("unreached")}}// sent message to 1 rdb// received hello from mychannel2func (*PubSub)ReceiveMessage¶
ReceiveMessage returns a Message or error ignoring Subscription and Pongmessages. This is low-level API and in most cases Channel should be usedinstead.
func (*PubSub)ReceiveTimeout¶
ReceiveTimeout acts like Receive but returns an error if messageis not received in time. This is low-level API and in most casesChannel should be used instead.
typeRing¶
type Ring struct {// contains filtered or unexported fields}Ring is a Redis client that uses consistent hashing to distributekeys across multiple Redis servers (shards). It's safe forconcurrent use by multiple goroutines.
Ring monitors the state of each shard and removes dead shards fromthe ring. When a shard comes online it is added back to the ring. Thisgives you maximum availability and partition tolerance, but noconsistency between different shards or even clients. Each clientuses shards that are available to the client and does not do anycoordination when shard state is changed.
Ring should be used when you need multiple Redis servers for cachingand can tolerate losing data when one of the servers dies.Otherwise you should use Redis Cluster.
funcNewRing¶
func NewRing(opt *RingOptions) *Ring
Example¶
rdb := redis.NewRing(&redis.RingOptions{Addrs: map[string]string{"shard1": ":7000","shard2": ":7001","shard3": ":7002",},})rdb.Ping(ctx)func (Ring)BRPopLPush¶
func (Ring)BgRewriteAOF¶
func (Ring)BitField¶
func (c Ring) BitField(ctxcontext.Context, keystring, args ...interface{}) *IntSliceCmd
func (Ring)ClientGetName¶
ClientGetName returns the name of the connection.
func (Ring)ClientKillByFilter¶
ClientKillByFilter is new style syntax, while the ClientKill is old
CLIENT KILL <option> [value] ... <option> [value]
func (Ring)ClientList¶
func (Ring)ClientUnblockWithError¶
func (*Ring)Close¶
Close closes the ring client, releasing any open resources.
It is rare to Close a Ring, as the Ring is meant to be long-livedand shared between many goroutines.
func (Ring)ClusterAddSlots¶
func (Ring)ClusterAddSlotsRange¶
func (Ring)ClusterCountFailureReports¶
func (Ring)ClusterCountKeysInSlot¶
func (Ring)ClusterDelSlots¶
func (Ring)ClusterDelSlotsRange¶
func (Ring)ClusterFailover¶
func (Ring)ClusterGetKeysInSlot¶
func (c Ring) ClusterGetKeysInSlot(ctxcontext.Context, slotint, countint) *StringSliceCmd
func (Ring)ClusterInfo¶
func (Ring)ClusterNodes¶
func (Ring)ClusterReplicate¶
func (Ring)ClusterResetHard¶
func (Ring)ClusterResetSoft¶
func (Ring)ClusterSaveConfig¶
func (Ring)ClusterSlaves¶
func (c Ring) ClusterSlaves(ctxcontext.Context, nodeIDstring) *StringSliceCmd
func (Ring)ClusterSlots¶
func (c Ring) ClusterSlots(ctxcontext.Context) *ClusterSlotsCmd
func (Ring)Command¶
func (c Ring) Command(ctxcontext.Context) *CommandsInfoCmd
func (Ring)ConfigResetStat¶
func (Ring)ConfigRewrite¶
func (Ring)FlushAllAsync¶
func (Ring)FlushDBAsync¶
func (*Ring)ForEachShard¶
func (c *Ring) ForEachShard(ctxcontext.Context,fn func(ctxcontext.Context, client *Client)error,)error
ForEachShard concurrently calls the fn on each live shard in the ring.It returns the first error if any.
func (Ring)GeoAdd¶
func (c Ring) GeoAdd(ctxcontext.Context, keystring, geoLocation ...*GeoLocation) *IntCmd
func (Ring)GeoHash¶
func (c Ring) GeoHash(ctxcontext.Context, keystring, members ...string) *StringSliceCmd
func (Ring)GeoRadius¶
func (c Ring) GeoRadius(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery,) *GeoLocationCmd
GeoRadius is a read-only GEORADIUS_RO command.
func (Ring)GeoRadiusByMember¶
func (c Ring) GeoRadiusByMember(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery,) *GeoLocationCmd
GeoRadiusByMember is a read-only GEORADIUSBYMEMBER_RO command.
func (Ring)GeoRadiusByMemberStore¶
func (c Ring) GeoRadiusByMemberStore(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery,) *IntCmd
GeoRadiusByMemberStore is a writing GEORADIUSBYMEMBER command.
func (Ring)GeoRadiusStore¶
func (c Ring) GeoRadiusStore(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery,) *IntCmd
GeoRadiusStore is a writing GEORADIUS command.
func (Ring)GeoSearch¶added inv8.11.1
func (c Ring) GeoSearch(ctxcontext.Context, keystring, q *GeoSearchQuery) *StringSliceCmd
func (Ring)GeoSearchLocation¶added inv8.11.1
func (c Ring) GeoSearchLocation(ctxcontext.Context, keystring, q *GeoSearchLocationQuery,) *GeoSearchLocationCmd
func (Ring)GeoSearchStore¶added inv8.11.1
func (c Ring) GeoSearchStore(ctxcontext.Context, key, storestring, q *GeoSearchStoreQuery) *IntCmd
func (Ring)GetEx¶added inv8.8.1
GetEx An expiration of zero removes the TTL associated with the key (i.e. GETEX key persist).Requires Redis >= 6.2.0.
func (Ring)HIncrByFloat¶
func (Ring)HMGet¶
HMGet returns the values for the specified fields in the hash stored at key.It returns an interface{} to distinguish between empty string and nil value.
func (Ring)HRandField¶added inv8.8.1
HRandField redis-server version >= 6.2.0.
func (Ring)HSet¶
HSet accepts values in following formats:
- HSet("myhash", "key1", "value1", "key2", "value2")
- HSet("myhash", []string{"key1", "value1", "key2", "value2"})
- HSet("myhash", map[string]interface{}{"key1": "value1", "key2": "value2"})
Note that it requires Redis v4 for multiple field/value pairs support.
func (Ring)IncrByFloat¶
func (Ring)LInsertAfter¶
func (Ring)LInsertBefore¶
func (Ring)LPopCount¶added inv8.8.3
func (c Ring) LPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmd
func (Ring)LRange¶
func (c Ring) LRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (Ring)MSet¶
MSet is like Set but accepts multiple values:
- MSet("key1", "value1", "key2", "value2")
- MSet([]string{"key1", "value1", "key2", "value2"})
- MSet(map[string]interface{}{"key1": "value1", "key2": "value2"})
func (Ring)MSetNX¶
MSetNX is like SetNX but accepts multiple values:
- MSetNX("key1", "value1", "key2", "value2")
- MSetNX([]string{"key1", "value1", "key2", "value2"})
- MSetNX(map[string]interface{}{"key1": "value1", "key2": "value2"})
func (Ring)MemoryUsage¶
func (Ring)ObjectIdleTime¶
func (c Ring) ObjectIdleTime(ctxcontext.Context, keystring) *DurationCmd
func (*Ring)Options¶
func (c *Ring) Options() *RingOptions
Options returns read-only Options that were used to create the client.
func (*Ring)PSubscribe¶
PSubscribe subscribes the client to the given patterns.
func (Ring)PubSubChannels¶
func (c Ring) PubSubChannels(ctxcontext.Context, patternstring) *StringSliceCmd
func (Ring)PubSubNumPat¶
func (Ring)PubSubNumSub¶
func (c Ring) PubSubNumSub(ctxcontext.Context, channels ...string) *StringIntMapCmd
func (Ring)RPopCount¶added inv8.11.1
func (c Ring) RPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmd
func (Ring)RestoreReplace¶
func (Ring)SDiffStore¶
func (Ring)SInterStore¶
func (Ring)SMIsMember¶added inv8.8.3
func (c Ring) SMIsMember(ctxcontext.Context, keystring, members ...interface{}) *BoolSliceCmd
SMIsMember Redis `SMISMEMBER key member [member ...]` command.
func (Ring)SMembers¶
func (c Ring) SMembers(ctxcontext.Context, keystring) *StringSliceCmd
SMembers Redis `SMEMBERS key` command output as a slice.
func (Ring)SMembersMap¶
func (c Ring) SMembersMap(ctxcontext.Context, keystring) *StringStructMapCmd
SMembersMap Redis `SMEMBERS key` command output as a map.
func (Ring)SPopN¶
func (c Ring) SPopN(ctxcontext.Context, keystring, countint64) *StringSliceCmd
SPopN Redis `SPOP key count` command.
func (Ring)SRandMember¶
SRandMember Redis `SRANDMEMBER key` command.
func (Ring)SRandMemberN¶
func (c Ring) SRandMemberN(ctxcontext.Context, keystring, countint64) *StringSliceCmd
SRandMemberN Redis `SRANDMEMBER key count` command.
func (Ring)SUnionStore¶
func (Ring)ScriptExists¶
func (c Ring) ScriptExists(ctxcontext.Context, hashes ...string) *BoolSliceCmd
func (Ring)ScriptFlush¶
func (Ring)ScriptKill¶
func (Ring)Set¶
func (c Ring) Set(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmd
Set Redis `SET key value [expiration]` command.Use expiration for `SETEX`-like behavior.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (Ring)SetArgs¶added inv8.6.0
SetArgs supports all the options that the SET command supports.It is the alternative to the Set function when you wantto have more control over the options.
func (Ring)SetEX¶added inv8.3.3
func (c Ring) SetEX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmd
SetEX Redis `SETEX key expiration value` command.
func (Ring)SetNX¶
func (c Ring) SetNX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmd
SetNX Redis `SET key value [expiration] NX` command.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (Ring)SetXX¶
func (c Ring) SetXX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmd
SetXX Redis `SET key value [expiration] XX` command.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (Ring)ShutdownNoSave¶
func (Ring)ShutdownSave¶
func (Ring)SlowLogGet¶
func (c Ring) SlowLogGet(ctxcontext.Context, numint64) *SlowLogCmd
func (Ring)SortInterfaces¶
func (*Ring)TxPipeline¶
func (*Ring)TxPipelined¶
func (Ring)XAdd¶
XAdd a.Limit has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046
func (Ring)XAutoClaim¶added inv8.11.0
func (c Ring) XAutoClaim(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimCmd
func (Ring)XAutoClaimJustID¶added inv8.11.0
func (c Ring) XAutoClaimJustID(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd
func (Ring)XClaim¶
func (c Ring) XClaim(ctxcontext.Context, a *XClaimArgs) *XMessageSliceCmd
func (Ring)XClaimJustID¶
func (c Ring) XClaimJustID(ctxcontext.Context, a *XClaimArgs) *StringSliceCmd
func (Ring)XGroupCreate¶
func (Ring)XGroupCreateConsumer¶added inv8.11.0
func (Ring)XGroupCreateMkStream¶
func (Ring)XGroupDelConsumer¶
func (Ring)XGroupDestroy¶
func (Ring)XGroupSetID¶
func (Ring)XInfoConsumers¶added inv8.6.0
func (c Ring) XInfoConsumers(ctxcontext.Context, keystring, groupstring) *XInfoConsumersCmd
func (Ring)XInfoGroups¶
func (c Ring) XInfoGroups(ctxcontext.Context, keystring) *XInfoGroupsCmd
func (Ring)XInfoStream¶added inv8.2.1
func (c Ring) XInfoStream(ctxcontext.Context, keystring) *XInfoStreamCmd
func (Ring)XInfoStreamFull¶added inv8.9.0
func (c Ring) XInfoStreamFull(ctxcontext.Context, keystring, countint) *XInfoStreamFullCmd
XInfoStreamFull XINFO STREAM FULL [COUNT count]redis-server >= 6.0.
func (Ring)XPendingExt¶
func (c Ring) XPendingExt(ctxcontext.Context, a *XPendingExtArgs) *XPendingExtCmd
func (Ring)XRange¶
func (c Ring) XRange(ctxcontext.Context, stream, start, stopstring) *XMessageSliceCmd
func (Ring)XRangeN¶
func (c Ring) XRangeN(ctxcontext.Context, stream, start, stopstring, countint64) *XMessageSliceCmd
func (Ring)XReadGroup¶
func (c Ring) XReadGroup(ctxcontext.Context, a *XReadGroupArgs) *XStreamSliceCmd
func (Ring)XReadStreams¶
func (c Ring) XReadStreams(ctxcontext.Context, streams ...string) *XStreamSliceCmd
func (Ring)XRevRange¶
func (c Ring) XRevRange(ctxcontext.Context, stream, start, stopstring) *XMessageSliceCmd
func (Ring)XRevRangeN¶
func (c Ring) XRevRangeN(ctxcontext.Context, stream, start, stopstring, countint64) *XMessageSliceCmd
func (Ring)XTrimMaxLen¶added inv8.11.0
XTrimMaxLen No `~` rules are used, `limit` cannot be used.cmd: XTRIM key MAXLEN maxLen
func (Ring)XTrimMaxLenApprox¶added inv8.11.0
XTrimMaxLenApprox LIMIT has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046cmd: XTRIM key MAXLEN ~ maxLen LIMIT limit
func (Ring)XTrimMinID¶added inv8.11.0
XTrimMinID No `~` rules are used, `limit` cannot be used.cmd: XTRIM key MINID minID
func (Ring)XTrimMinIDApprox¶added inv8.11.0
XTrimMinIDApprox LIMIT has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046cmd: XTRIM key MINID ~ minID LIMIT limit
func (Ring)ZAddArgsIncr¶added inv8.11.0
func (Ring)ZAddCh¶
ZAddCh Redis `ZADD key CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{Ch: true,Members: []Z,})remove in v9.func (Ring)ZAddNXCh¶
ZAddNXCh Redis `ZADD key NX CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{NX: true,Ch: true,Members: []Z,})remove in v9.func (Ring)ZAddXXCh¶
ZAddXXCh Redis `ZADD key XX CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{XX: true,Ch: true,Members: []Z,})remove in v9.func (Ring)ZDiff¶added inv8.9.0
func (c Ring) ZDiff(ctxcontext.Context, keys ...string) *StringSliceCmd
ZDiff redis-server version >= 6.2.0.
func (Ring)ZDiffStore¶added inv8.10.0
ZDiffStore redis-server version >=6.2.0.
func (Ring)ZDiffWithScores¶added inv8.9.0
ZDiffWithScores redis-server version >= 6.2.0.
func (Ring)ZIncr¶
ZIncr Redis `ZADD key INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{Members: []Z,})remove in v9.func (Ring)ZIncrNX¶
ZIncrNX Redis `ZADD key NX INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{NX: true,Members: []Z,})remove in v9.func (Ring)ZIncrXX¶
ZIncrXX Redis `ZADD key XX INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{XX: true,Members: []Z,})remove in v9.func (Ring)ZInter¶added inv8.10.0
func (c Ring) ZInter(ctxcontext.Context, store *ZStore) *StringSliceCmd
func (Ring)ZInterStore¶
func (Ring)ZInterWithScores¶added inv8.10.0
func (Ring)ZMScore¶added inv8.8.0
func (c Ring) ZMScore(ctxcontext.Context, keystring, members ...string) *FloatSliceCmd
func (Ring)ZRandMember¶added inv8.8.1
ZRandMember redis-server version >= 6.2.0.
func (Ring)ZRange¶
func (c Ring) ZRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (Ring)ZRangeArgs¶added inv8.11.0
func (c Ring) ZRangeArgs(ctxcontext.Context, zZRangeArgs) *StringSliceCmd
func (Ring)ZRangeArgsWithScores¶added inv8.11.0
func (c Ring) ZRangeArgsWithScores(ctxcontext.Context, zZRangeArgs) *ZSliceCmd
func (Ring)ZRangeByLex¶
func (c Ring) ZRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Ring)ZRangeByScore¶
func (c Ring) ZRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Ring)ZRangeByScoreWithScores¶
func (Ring)ZRangeStore¶added inv8.11.0
func (c Ring) ZRangeStore(ctxcontext.Context, dststring, zZRangeArgs) *IntCmd
func (Ring)ZRangeWithScores¶
func (Ring)ZRemRangeByLex¶
func (Ring)ZRemRangeByRank¶
func (Ring)ZRemRangeByScore¶
func (Ring)ZRevRange¶
func (c Ring) ZRevRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (Ring)ZRevRangeByLex¶
func (c Ring) ZRevRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Ring)ZRevRangeByScore¶
func (c Ring) ZRevRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Ring)ZRevRangeByScoreWithScores¶
func (Ring)ZRevRangeWithScores¶
func (Ring)ZUnion¶added inv8.11.0
func (c Ring) ZUnion(ctxcontext.Context, storeZStore) *StringSliceCmd
func (Ring)ZUnionStore¶
typeRingOptions¶
type RingOptions struct {// Map of name => host:port addresses of ring shards.Addrs map[string]string// NewClient creates a shard client with provided name and options.NewClient func(namestring, opt *Options) *Client// Frequency of PING commands sent to check shards availability.// Shard is considered down after 3 subsequent failed checks.HeartbeatFrequencytime.Duration// NewConsistentHash returns a consistent hash that is used// to distribute keys across the shards.//// Seehttps://medium.com/@dgryski/consistent-hashing-algorithmic-tradeoffs-ef6b8e2fcae8// for consistent hashing algorithmic tradeoffs.NewConsistentHash func(shards []string)ConsistentHashDialer func(ctxcontext.Context, network, addrstring) (net.Conn,error)OnConnect func(ctxcontext.Context, cn *Conn)errorUsernamestringPasswordstringDBintMaxRetriesintMinRetryBackofftime.DurationMaxRetryBackofftime.DurationDialTimeouttime.DurationReadTimeouttime.DurationWriteTimeouttime.Duration// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).PoolFIFOboolPoolSizeintMinIdleConnsintMaxConnAgetime.DurationPoolTimeouttime.DurationIdleTimeouttime.DurationIdleCheckFrequencytime.DurationTLSConfig *tls.ConfigLimiterLimiter}RingOptions are used to configure a ring client and should bepassed to NewRing.
typeScanCmd¶
type ScanCmd struct {// contains filtered or unexported fields}funcNewScanCmd¶
funcNewScanCmdResult¶
NewScanCmdResult returns a ScanCmd initialised with val and err for testing.
func (*ScanCmd)Iterator¶
func (cmd *ScanCmd) Iterator() *ScanIterator
Iterator creates a new ScanIterator.
Example¶
iter := rdb.Scan(ctx, 0, "", 0).Iterator()for iter.Next(ctx) {fmt.Println(iter.Val())}if err := iter.Err(); err != nil {panic(err)}func (*ScanCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *ScanCmd) SetFirstKeyPos(keyPosint8)
typeScanIterator¶
type ScanIterator struct {// contains filtered or unexported fields}ScanIterator is used to incrementally iterate over a collection of elements.It's safe for concurrent use by multiple goroutines.
Example¶
iter := rdb.Scan(ctx, 0, "", 0).Iterator()for iter.Next(ctx) {fmt.Println(iter.Val())}if err := iter.Err(); err != nil {panic(err)}func (*ScanIterator)Err¶
func (it *ScanIterator) Err()error
Err returns the last iterator error, if any.
func (*ScanIterator)Next¶
func (it *ScanIterator) Next(ctxcontext.Context)bool
Next advances the cursor and returns true if more values can be read.
func (*ScanIterator)Val¶
func (it *ScanIterator) Val()string
Val returns the key/field at the current cursor position.
typeScript¶
type Script struct {// contains filtered or unexported fields}Example¶
IncrByXX := redis.NewScript(`if redis.call("GET", KEYS[1]) ~= false thenreturn redis.call("INCRBY", KEYS[1], ARGV[1])endreturn false`)n, err := IncrByXX.Run(ctx, rdb, []string{"xx_counter"}, 2).Result()fmt.Println(n, err)err = rdb.Set(ctx, "xx_counter", "40", 0).Err()if err != nil {panic(err)}n, err = IncrByXX.Run(ctx, rdb, []string{"xx_counter"}, 2).Result()fmt.Println(n, err)Output:<nil> redis: nil42 <nil>
typeScripter¶added inv8.4.11
type Scripter interface {Eval(ctxcontext.Context, scriptstring, keys []string, args ...interface{}) *CmdEvalSha(ctxcontext.Context, sha1string, keys []string, args ...interface{}) *CmdScriptExists(ctxcontext.Context, hashes ...string) *BoolSliceCmdScriptLoad(ctxcontext.Context, scriptstring) *StringCmd}typeSentinelClient¶
type SentinelClient struct {// contains filtered or unexported fields}SentinelClient is a client for a Redis Sentinel.
funcNewSentinelClient¶
func NewSentinelClient(opt *Options) *SentinelClient
func (*SentinelClient)CkQuorum¶
func (c *SentinelClient) CkQuorum(ctxcontext.Context, namestring) *StringCmd
CkQuorum checks if the current Sentinel configuration is able to reach thequorum needed to failover a master, and the majority needed to authorize thefailover. This command should be used in monitoring systems to check if aSentinel deployment is ok.
func (SentinelClient)Close¶
func (c SentinelClient) Close()error
Close closes the client, releasing any open resources.
It is rare to Close a Client, as the Client is meant to belong-lived and shared between many goroutines.
func (*SentinelClient)Context¶
func (c *SentinelClient) Context()context.Context
func (*SentinelClient)Failover¶
func (c *SentinelClient) Failover(ctxcontext.Context, namestring) *StatusCmd
Failover forces a failover as if the master was not reachable, and withoutasking for agreement to other Sentinels.
func (*SentinelClient)FlushConfig¶
func (c *SentinelClient) FlushConfig(ctxcontext.Context) *StatusCmd
FlushConfig forces Sentinel to rewrite its configuration on disk, includingthe current Sentinel state.
func (*SentinelClient)GetMasterAddrByName¶
func (c *SentinelClient) GetMasterAddrByName(ctxcontext.Context, namestring) *StringSliceCmd
func (*SentinelClient)Master¶
func (c *SentinelClient) Master(ctxcontext.Context, namestring) *StringStringMapCmd
Master shows the state and info of the specified master.
func (*SentinelClient)Masters¶
func (c *SentinelClient) Masters(ctxcontext.Context) *SliceCmd
Masters shows a list of monitored masters and their state.
func (*SentinelClient)Monitor¶
func (c *SentinelClient) Monitor(ctxcontext.Context, name, ip, port, quorumstring) *StringCmd
Monitor tells the Sentinel to start monitoring a new master with the specifiedname, ip, port, and quorum.
func (*SentinelClient)PSubscribe¶
func (c *SentinelClient) PSubscribe(ctxcontext.Context, channels ...string) *PubSub
PSubscribe subscribes the client to the given patterns.Patterns can be omitted to create empty subscription.
func (*SentinelClient)Ping¶
func (c *SentinelClient) Ping(ctxcontext.Context) *StringCmd
Ping is used to test if a connection is still alive, or tomeasure latency.
func (*SentinelClient)Remove¶
func (c *SentinelClient) Remove(ctxcontext.Context, namestring) *StringCmd
Remove is used in order to remove the specified master: the master will nolonger be monitored, and will totally be removed from the internal state ofthe Sentinel.
func (*SentinelClient)Reset¶
func (c *SentinelClient) Reset(ctxcontext.Context, patternstring) *IntCmd
Reset resets all the masters with matching name. The pattern argument is aglob-style pattern. The reset process clears any previous state in a master(including a failover in progress), and removes every slave and sentinelalready discovered and associated with the master.
func (*SentinelClient)Sentinels¶
func (c *SentinelClient) Sentinels(ctxcontext.Context, namestring) *SliceCmd
func (*SentinelClient)Set¶
func (c *SentinelClient) Set(ctxcontext.Context, name, option, valuestring) *StringCmd
Set is used in order to change configuration parameters of a specific master.
func (*SentinelClient)Slaves¶
func (c *SentinelClient) Slaves(ctxcontext.Context, namestring) *SliceCmd
Slaves shows a list of slaves for the specified master and their state.
func (*SentinelClient)Subscribe¶
func (c *SentinelClient) Subscribe(ctxcontext.Context, channels ...string) *PubSub
Subscribe subscribes the client to the specified channels.Channels can be omitted to create empty subscription.
func (*SentinelClient)WithContext¶
func (c *SentinelClient) WithContext(ctxcontext.Context) *SentinelClient
typeSetArgs¶added inv8.6.0
type SetArgs struct {// Mode can be `NX` or `XX` or empty.Modestring// Zero `TTL` or `Expiration` means that the key has no expiration time.TTLtime.DurationExpireAttime.Time// When Get is true, the command returns the old value stored at key, or nil when key did not exist.Getbool// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,// otherwise you will receive an error: (error) ERR syntax error.KeepTTLbool}SetArgs provides arguments for the SetArgs function.
typeSliceCmd¶
type SliceCmd struct {// contains filtered or unexported fields}funcNewSliceCmd¶
funcNewSliceResult¶
NewSliceResult returns a SliceCmd initialised with val and err for testing.
func (*SliceCmd)Scan¶added inv8.5.0
Scan scans the results from the map into a destination struct. The map keysare matched in the Redis struct fields by the `redis:"field"` tag.
Example¶
ExampleSliceCmd_Scan shows how to scan the results of a multi key fetchinto a struct.
rdb.FlushDB(ctx)err := rdb.MSet(ctx,"name", "hello","count", 123,"correct", true).Err()if err != nil {panic(err)}res := rdb.MGet(ctx, "name", "count", "empty", "correct")if res.Err() != nil {panic(err)}type data struct {Name string `redis:"name"`Count int `redis:"count"`Correct bool `redis:"correct"`}// Scan the results into the struct.var d dataif err := res.Scan(&d); err != nil {panic(err)}fmt.Println(d)Output:{hello 123 true}
func (*SliceCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *SliceCmd) SetFirstKeyPos(keyPosint8)
typeSlowLogCmd¶
type SlowLogCmd struct {// contains filtered or unexported fields}funcNewSlowLogCmd¶
func NewSlowLogCmd(ctxcontext.Context, args ...interface{}) *SlowLogCmd
func (*SlowLogCmd)Result¶
func (cmd *SlowLogCmd) Result() ([]SlowLog,error)
func (*SlowLogCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *SlowLogCmd) SetFirstKeyPos(keyPosint8)
func (*SlowLogCmd)SetVal¶added inv8.11.4
func (cmd *SlowLogCmd) SetVal(val []SlowLog)
func (*SlowLogCmd)String¶
func (cmd *SlowLogCmd) String()string
func (*SlowLogCmd)Val¶
func (cmd *SlowLogCmd) Val() []SlowLog
typeStatefulCmdable¶
type StatefulCmdable interface {CmdableAuth(ctxcontext.Context, passwordstring) *StatusCmdAuthACL(ctxcontext.Context, username, passwordstring) *StatusCmdSelect(ctxcontext.Context, indexint) *StatusCmdSwapDB(ctxcontext.Context, index1, index2int) *StatusCmdClientSetName(ctxcontext.Context, namestring) *BoolCmd}typeStatusCmd¶
type StatusCmd struct {// contains filtered or unexported fields}funcNewStatusCmd¶
funcNewStatusResult¶
NewStatusResult returns a StatusCmd initialised with val and err for testing.
func (*StatusCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *StatusCmd) SetFirstKeyPos(keyPosint8)
typeStringCmd¶
type StringCmd struct {// contains filtered or unexported fields}funcNewStringCmd¶
funcNewStringResult¶
NewStringResult returns a StringCmd initialised with val and err for testing.
func (*StringCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *StringCmd) SetFirstKeyPos(keyPosint8)
typeStringIntMapCmd¶
type StringIntMapCmd struct {// contains filtered or unexported fields}funcNewStringIntMapCmd¶
func NewStringIntMapCmd(ctxcontext.Context, args ...interface{}) *StringIntMapCmd
funcNewStringIntMapCmdResult¶
func NewStringIntMapCmdResult(val map[string]int64, errerror) *StringIntMapCmd
NewStringIntMapCmdResult returns a StringIntMapCmd initialised with val and err for testing.
func (*StringIntMapCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *StringIntMapCmd) SetFirstKeyPos(keyPosint8)
func (*StringIntMapCmd)SetVal¶added inv8.11.4
func (cmd *StringIntMapCmd) SetVal(val map[string]int64)
func (*StringIntMapCmd)String¶
func (cmd *StringIntMapCmd) String()string
func (*StringIntMapCmd)Val¶
func (cmd *StringIntMapCmd) Val() map[string]int64
typeStringSliceCmd¶
type StringSliceCmd struct {// contains filtered or unexported fields}funcNewStringSliceCmd¶
func NewStringSliceCmd(ctxcontext.Context, args ...interface{}) *StringSliceCmd
funcNewStringSliceResult¶
func NewStringSliceResult(val []string, errerror) *StringSliceCmd
NewStringSliceResult returns a StringSliceCmd initialised with val and err for testing.
func (*StringSliceCmd)Result¶
func (cmd *StringSliceCmd) Result() ([]string,error)
func (*StringSliceCmd)ScanSlice¶
func (cmd *StringSliceCmd) ScanSlice(container interface{})error
func (*StringSliceCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *StringSliceCmd) SetFirstKeyPos(keyPosint8)
func (*StringSliceCmd)SetVal¶added inv8.11.4
func (cmd *StringSliceCmd) SetVal(val []string)
func (*StringSliceCmd)String¶
func (cmd *StringSliceCmd) String()string
func (*StringSliceCmd)Val¶
func (cmd *StringSliceCmd) Val() []string
typeStringStringMapCmd¶
type StringStringMapCmd struct {// contains filtered or unexported fields}funcNewStringStringMapCmd¶
func NewStringStringMapCmd(ctxcontext.Context, args ...interface{}) *StringStringMapCmd
funcNewStringStringMapResult¶
func NewStringStringMapResult(val map[string]string, errerror) *StringStringMapCmd
NewStringStringMapResult returns a StringStringMapCmd initialised with val and err for testing.
func (*StringStringMapCmd)Scan¶added inv8.5.0
func (cmd *StringStringMapCmd) Scan(dest interface{})error
Scan scans the results from the map into a destination struct. The map keysare matched in the Redis struct fields by the `redis:"field"` tag.
Example¶
ExampleStringStringMapCmd_Scan shows how to scan the results of a map fetchinto a struct.
rdb.FlushDB(ctx)err := rdb.HMSet(ctx, "map","name", "hello","count", 123,"correct", true).Err()if err != nil {panic(err)}// Get the map. The same approach works for HmGet().res := rdb.HGetAll(ctx, "map")if res.Err() != nil {panic(err)}type data struct {Name string `redis:"name"`Count int `redis:"count"`Correct bool `redis:"correct"`}// Scan the results into the struct.var d dataif err := res.Scan(&d); err != nil {panic(err)}fmt.Println(d)Output:{hello 123 true}
func (*StringStringMapCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *StringStringMapCmd) SetFirstKeyPos(keyPosint8)
func (*StringStringMapCmd)SetVal¶added inv8.11.4
func (cmd *StringStringMapCmd) SetVal(val map[string]string)
func (*StringStringMapCmd)String¶
func (cmd *StringStringMapCmd) String()string
func (*StringStringMapCmd)Val¶
func (cmd *StringStringMapCmd) Val() map[string]string
typeStringStructMapCmd¶
type StringStructMapCmd struct {// contains filtered or unexported fields}funcNewStringStructMapCmd¶
func NewStringStructMapCmd(ctxcontext.Context, args ...interface{}) *StringStructMapCmd
func (*StringStructMapCmd)Result¶
func (cmd *StringStructMapCmd) Result() (map[string]struct{},error)
func (*StringStructMapCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *StringStructMapCmd) SetFirstKeyPos(keyPosint8)
func (*StringStructMapCmd)SetVal¶added inv8.11.4
func (cmd *StringStructMapCmd) SetVal(val map[string]struct{})
func (*StringStructMapCmd)String¶
func (cmd *StringStructMapCmd) String()string
func (*StringStructMapCmd)Val¶
func (cmd *StringStructMapCmd) Val() map[string]struct{}
typeSubscription¶
type Subscription struct {// Can be "subscribe", "unsubscribe", "psubscribe" or "punsubscribe".Kindstring// Channel name we have subscribed to.Channelstring// Number of channels we are currently subscribed to.Countint}Subscription received after a successful subscription to channel.
func (*Subscription)String¶
func (m *Subscription) String()string
typeTimeCmd¶
type TimeCmd struct {// contains filtered or unexported fields}funcNewTimeCmd¶
funcNewTimeCmdResult¶
NewTimeCmdResult returns a TimeCmd initialised with val and err for testing.
func (*TimeCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *TimeCmd) SetFirstKeyPos(keyPosint8)
typeTx¶
type Tx struct {// contains filtered or unexported fields}Tx implements Redis transactions as described inhttp://redis.io/topics/transactions. It's NOT safe for concurrent useby multiple goroutines, because Exec resets list of watched keys.
If you don't need WATCH, use Pipeline instead.
func (Tx)AuthACL¶
AuthACL Perform an AUTH command, using the given user and pass.Should be used to authenticate the current connection with one of the connections defined in the ACL listwhen connecting to a Redis 6.0 instance, or greater, that is using the Redis ACL system.
func (Tx)BRPopLPush¶
func (Tx)BgRewriteAOF¶
func (Tx)BitField¶
func (c Tx) BitField(ctxcontext.Context, keystring, args ...interface{}) *IntSliceCmd
func (Tx)ClientGetName¶
ClientGetName returns the name of the connection.
func (Tx)ClientKillByFilter¶
ClientKillByFilter is new style syntax, while the ClientKill is old
CLIENT KILL <option> [value] ... <option> [value]
func (Tx)ClientList¶
func (Tx)ClientSetName¶
ClientSetName assigns a name to the connection.
func (Tx)ClientUnblockWithError¶
func (Tx)ClusterAddSlotsRange¶
func (Tx)ClusterCountFailureReports¶
func (Tx)ClusterCountKeysInSlot¶
func (Tx)ClusterDelSlotsRange¶
func (Tx)ClusterFailover¶
func (Tx)ClusterGetKeysInSlot¶
func (c Tx) ClusterGetKeysInSlot(ctxcontext.Context, slotint, countint) *StringSliceCmd
func (Tx)ClusterInfo¶
func (Tx)ClusterNodes¶
func (Tx)ClusterResetHard¶
func (Tx)ClusterResetSoft¶
func (Tx)ClusterSaveConfig¶
func (Tx)ClusterSlaves¶
func (c Tx) ClusterSlaves(ctxcontext.Context, nodeIDstring) *StringSliceCmd
func (Tx)ClusterSlots¶
func (c Tx) ClusterSlots(ctxcontext.Context) *ClusterSlotsCmd
func (Tx)Command¶
func (c Tx) Command(ctxcontext.Context) *CommandsInfoCmd
func (Tx)ConfigResetStat¶
func (Tx)ConfigRewrite¶
func (Tx)FlushAllAsync¶
func (Tx)FlushDBAsync¶
func (Tx)GeoAdd¶
func (c Tx) GeoAdd(ctxcontext.Context, keystring, geoLocation ...*GeoLocation) *IntCmd
func (Tx)GeoHash¶
func (c Tx) GeoHash(ctxcontext.Context, keystring, members ...string) *StringSliceCmd
func (Tx)GeoRadius¶
func (c Tx) GeoRadius(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery,) *GeoLocationCmd
GeoRadius is a read-only GEORADIUS_RO command.
func (Tx)GeoRadiusByMember¶
func (c Tx) GeoRadiusByMember(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery,) *GeoLocationCmd
GeoRadiusByMember is a read-only GEORADIUSBYMEMBER_RO command.
func (Tx)GeoRadiusByMemberStore¶
func (c Tx) GeoRadiusByMemberStore(ctxcontext.Context, key, memberstring, query *GeoRadiusQuery,) *IntCmd
GeoRadiusByMemberStore is a writing GEORADIUSBYMEMBER command.
func (Tx)GeoRadiusStore¶
func (c Tx) GeoRadiusStore(ctxcontext.Context, keystring, longitude, latitudefloat64, query *GeoRadiusQuery,) *IntCmd
GeoRadiusStore is a writing GEORADIUS command.
func (Tx)GeoSearch¶added inv8.11.1
func (c Tx) GeoSearch(ctxcontext.Context, keystring, q *GeoSearchQuery) *StringSliceCmd
func (Tx)GeoSearchLocation¶added inv8.11.1
func (c Tx) GeoSearchLocation(ctxcontext.Context, keystring, q *GeoSearchLocationQuery,) *GeoSearchLocationCmd
func (Tx)GeoSearchStore¶added inv8.11.1
func (c Tx) GeoSearchStore(ctxcontext.Context, key, storestring, q *GeoSearchStoreQuery) *IntCmd
func (Tx)GetEx¶added inv8.8.1
GetEx An expiration of zero removes the TTL associated with the key (i.e. GETEX key persist).Requires Redis >= 6.2.0.
func (Tx)HIncrByFloat¶
func (Tx)HMGet¶
HMGet returns the values for the specified fields in the hash stored at key.It returns an interface{} to distinguish between empty string and nil value.
func (Tx)HRandField¶added inv8.8.1
HRandField redis-server version >= 6.2.0.
func (Tx)HSet¶
HSet accepts values in following formats:
- HSet("myhash", "key1", "value1", "key2", "value2")
- HSet("myhash", []string{"key1", "value1", "key2", "value2"})
- HSet("myhash", map[string]interface{}{"key1": "value1", "key2": "value2"})
Note that it requires Redis v4 for multiple field/value pairs support.
func (Tx)LInsertAfter¶
func (Tx)LInsertBefore¶
func (Tx)LPopCount¶added inv8.8.3
func (c Tx) LPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmd
func (Tx)MSet¶
MSet is like Set but accepts multiple values:
- MSet("key1", "value1", "key2", "value2")
- MSet([]string{"key1", "value1", "key2", "value2"})
- MSet(map[string]interface{}{"key1": "value1", "key2": "value2"})
func (Tx)MSetNX¶
MSetNX is like SetNX but accepts multiple values:
- MSetNX("key1", "value1", "key2", "value2")
- MSetNX([]string{"key1", "value1", "key2", "value2"})
- MSetNX(map[string]interface{}{"key1": "value1", "key2": "value2"})
func (Tx)ObjectIdleTime¶
func (c Tx) ObjectIdleTime(ctxcontext.Context, keystring) *DurationCmd
func (*Tx)Pipelined¶
Pipelined executes commands queued in the fn outside of the transaction.Use TxPipelined if you need transactional behavior.
func (Tx)PubSubChannels¶
func (c Tx) PubSubChannels(ctxcontext.Context, patternstring) *StringSliceCmd
func (Tx)PubSubNumPat¶
func (Tx)PubSubNumSub¶
func (c Tx) PubSubNumSub(ctxcontext.Context, channels ...string) *StringIntMapCmd
func (Tx)RPopCount¶added inv8.11.1
func (c Tx) RPopCount(ctxcontext.Context, keystring, countint) *StringSliceCmd
func (Tx)RestoreReplace¶
func (Tx)SDiffStore¶
func (Tx)SInterStore¶
func (Tx)SMIsMember¶added inv8.8.3
func (c Tx) SMIsMember(ctxcontext.Context, keystring, members ...interface{}) *BoolSliceCmd
SMIsMember Redis `SMISMEMBER key member [member ...]` command.
func (Tx)SMembers¶
func (c Tx) SMembers(ctxcontext.Context, keystring) *StringSliceCmd
SMembers Redis `SMEMBERS key` command output as a slice.
func (Tx)SMembersMap¶
func (c Tx) SMembersMap(ctxcontext.Context, keystring) *StringStructMapCmd
SMembersMap Redis `SMEMBERS key` command output as a map.
func (Tx)SPopN¶
func (c Tx) SPopN(ctxcontext.Context, keystring, countint64) *StringSliceCmd
SPopN Redis `SPOP key count` command.
func (Tx)SRandMember¶
SRandMember Redis `SRANDMEMBER key` command.
func (Tx)SRandMemberN¶
func (c Tx) SRandMemberN(ctxcontext.Context, keystring, countint64) *StringSliceCmd
SRandMemberN Redis `SRANDMEMBER key count` command.
func (Tx)SUnionStore¶
func (Tx)ScriptExists¶
func (c Tx) ScriptExists(ctxcontext.Context, hashes ...string) *BoolSliceCmd
func (Tx)ScriptFlush¶
func (Tx)ScriptKill¶
func (Tx)Set¶
func (c Tx) Set(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmd
Set Redis `SET key value [expiration]` command.Use expiration for `SETEX`-like behavior.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (Tx)SetArgs¶added inv8.6.0
SetArgs supports all the options that the SET command supports.It is the alternative to the Set function when you wantto have more control over the options.
func (Tx)SetEX¶added inv8.3.3
func (c Tx) SetEX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *StatusCmd
SetEX Redis `SETEX key expiration value` command.
func (Tx)SetNX¶
func (c Tx) SetNX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmd
SetNX Redis `SET key value [expiration] NX` command.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (Tx)SetXX¶
func (c Tx) SetXX(ctxcontext.Context, keystring, value interface{}, expirationtime.Duration) *BoolCmd
SetXX Redis `SET key value [expiration] XX` command.
Zero expiration means the key has no expiration time.KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,otherwise you will receive an error: (error) ERR syntax error.
func (Tx)ShutdownNoSave¶
func (Tx)ShutdownSave¶
func (Tx)SlowLogGet¶
func (c Tx) SlowLogGet(ctxcontext.Context, numint64) *SlowLogCmd
func (Tx)SortInterfaces¶
func (*Tx)TxPipeline¶
TxPipeline creates a pipeline. Usually it is more convenient to use TxPipelined.
func (*Tx)TxPipelined¶
TxPipelined executes commands queued in the fn in the transaction.
When using WATCH, EXEC will execute commands only if the watched keyswere not modified, allowing for a check-and-set mechanism.
Exec always returns list of commands. If transaction failsTxFailedErr is returned. Otherwise Exec returns an error of the firstfailed command or nil.
func (Tx)XAdd¶
XAdd a.Limit has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046
func (Tx)XAutoClaim¶added inv8.11.0
func (c Tx) XAutoClaim(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimCmd
func (Tx)XAutoClaimJustID¶added inv8.11.0
func (c Tx) XAutoClaimJustID(ctxcontext.Context, a *XAutoClaimArgs) *XAutoClaimJustIDCmd
func (Tx)XClaim¶
func (c Tx) XClaim(ctxcontext.Context, a *XClaimArgs) *XMessageSliceCmd
func (Tx)XClaimJustID¶
func (c Tx) XClaimJustID(ctxcontext.Context, a *XClaimArgs) *StringSliceCmd
func (Tx)XGroupCreate¶
func (Tx)XGroupCreateConsumer¶added inv8.11.0
func (Tx)XGroupCreateMkStream¶
func (Tx)XGroupDelConsumer¶
func (Tx)XGroupSetID¶
func (Tx)XInfoConsumers¶added inv8.6.0
func (c Tx) XInfoConsumers(ctxcontext.Context, keystring, groupstring) *XInfoConsumersCmd
func (Tx)XInfoGroups¶
func (c Tx) XInfoGroups(ctxcontext.Context, keystring) *XInfoGroupsCmd
func (Tx)XInfoStream¶added inv8.2.1
func (c Tx) XInfoStream(ctxcontext.Context, keystring) *XInfoStreamCmd
func (Tx)XInfoStreamFull¶added inv8.9.0
func (c Tx) XInfoStreamFull(ctxcontext.Context, keystring, countint) *XInfoStreamFullCmd
XInfoStreamFull XINFO STREAM FULL [COUNT count]redis-server >= 6.0.
func (Tx)XPendingExt¶
func (c Tx) XPendingExt(ctxcontext.Context, a *XPendingExtArgs) *XPendingExtCmd
func (Tx)XRangeN¶
func (c Tx) XRangeN(ctxcontext.Context, stream, start, stopstring, countint64) *XMessageSliceCmd
func (Tx)XReadGroup¶
func (c Tx) XReadGroup(ctxcontext.Context, a *XReadGroupArgs) *XStreamSliceCmd
func (Tx)XReadStreams¶
func (c Tx) XReadStreams(ctxcontext.Context, streams ...string) *XStreamSliceCmd
func (Tx)XRevRange¶
func (c Tx) XRevRange(ctxcontext.Context, stream, start, stopstring) *XMessageSliceCmd
func (Tx)XRevRangeN¶
func (c Tx) XRevRangeN(ctxcontext.Context, stream, start, stopstring, countint64) *XMessageSliceCmd
func (Tx)XTrimMaxLen¶added inv8.11.0
XTrimMaxLen No `~` rules are used, `limit` cannot be used.cmd: XTRIM key MAXLEN maxLen
func (Tx)XTrimMaxLenApprox¶added inv8.11.0
XTrimMaxLenApprox LIMIT has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046cmd: XTRIM key MAXLEN ~ maxLen LIMIT limit
func (Tx)XTrimMinID¶added inv8.11.0
XTrimMinID No `~` rules are used, `limit` cannot be used.cmd: XTRIM key MINID minID
func (Tx)XTrimMinIDApprox¶added inv8.11.0
XTrimMinIDApprox LIMIT has a bug, please confirm it and use it.issue:https://github.com/redis/redis/issues/9046cmd: XTRIM key MINID ~ minID LIMIT limit
func (Tx)ZAddArgsIncr¶added inv8.11.0
func (Tx)ZAddCh¶
ZAddCh Redis `ZADD key CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{Ch: true,Members: []Z,})remove in v9.func (Tx)ZAddNXCh¶
ZAddNXCh Redis `ZADD key NX CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{NX: true,Ch: true,Members: []Z,})remove in v9.func (Tx)ZAddXXCh¶
ZAddXXCh Redis `ZADD key XX CH score member [score member ...]` command.Deprecated: Use
client.ZAddArgs(ctx, ZAddArgs{XX: true,Ch: true,Members: []Z,})remove in v9.func (Tx)ZDiff¶added inv8.9.0
func (c Tx) ZDiff(ctxcontext.Context, keys ...string) *StringSliceCmd
ZDiff redis-server version >= 6.2.0.
func (Tx)ZDiffStore¶added inv8.10.0
ZDiffStore redis-server version >=6.2.0.
func (Tx)ZDiffWithScores¶added inv8.9.0
ZDiffWithScores redis-server version >= 6.2.0.
func (Tx)ZIncr¶
ZIncr Redis `ZADD key INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{Members: []Z,})remove in v9.func (Tx)ZIncrNX¶
ZIncrNX Redis `ZADD key NX INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{NX: true,Members: []Z,})remove in v9.func (Tx)ZIncrXX¶
ZIncrXX Redis `ZADD key XX INCR score member` command.Deprecated: Use
client.ZAddArgsIncr(ctx, ZAddArgs{XX: true,Members: []Z,})remove in v9.func (Tx)ZInter¶added inv8.10.0
func (c Tx) ZInter(ctxcontext.Context, store *ZStore) *StringSliceCmd
func (Tx)ZInterStore¶
func (Tx)ZInterWithScores¶added inv8.10.0
func (Tx)ZMScore¶added inv8.8.0
func (c Tx) ZMScore(ctxcontext.Context, keystring, members ...string) *FloatSliceCmd
func (Tx)ZRandMember¶added inv8.8.1
ZRandMember redis-server version >= 6.2.0.
func (Tx)ZRangeArgs¶added inv8.11.0
func (c Tx) ZRangeArgs(ctxcontext.Context, zZRangeArgs) *StringSliceCmd
func (Tx)ZRangeArgsWithScores¶added inv8.11.0
func (c Tx) ZRangeArgsWithScores(ctxcontext.Context, zZRangeArgs) *ZSliceCmd
func (Tx)ZRangeByLex¶
func (c Tx) ZRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Tx)ZRangeByScore¶
func (c Tx) ZRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Tx)ZRangeByScoreWithScores¶
func (Tx)ZRangeStore¶added inv8.11.0
func (c Tx) ZRangeStore(ctxcontext.Context, dststring, zZRangeArgs) *IntCmd
func (Tx)ZRangeWithScores¶
func (Tx)ZRemRangeByRank¶
func (Tx)ZRemRangeByScore¶
func (Tx)ZRevRange¶
func (c Tx) ZRevRange(ctxcontext.Context, keystring, start, stopint64) *StringSliceCmd
func (Tx)ZRevRangeByLex¶
func (c Tx) ZRevRangeByLex(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Tx)ZRevRangeByScore¶
func (c Tx) ZRevRangeByScore(ctxcontext.Context, keystring, opt *ZRangeBy) *StringSliceCmd
func (Tx)ZRevRangeByScoreWithScores¶
func (Tx)ZRevRangeWithScores¶
typeUniversalClient¶
type UniversalClient interface {CmdableContext()context.ContextAddHook(Hook)Watch(ctxcontext.Context, fn func(*Tx)error, keys ...string)errorDo(ctxcontext.Context, args ...interface{}) *CmdProcess(ctxcontext.Context, cmdCmder)errorSubscribe(ctxcontext.Context, channels ...string) *PubSubPSubscribe(ctxcontext.Context, channels ...string) *PubSubClose()errorPoolStats() *PoolStats}UniversalClient is an abstract client which - based on the provided options -represents either a ClusterClient, a FailoverClient, or a single-node Client.This can be useful for testing cluster-specific applications locally or having differentclients in different environments.
funcNewUniversalClient¶
func NewUniversalClient(opts *UniversalOptions)UniversalClient
NewUniversalClient returns a new multi client. The type of the returned client dependson the following conditions:
1. If the MasterName option is specified, a sentinel-backed FailoverClient is returned.2. if the number of Addrs is two or more, a ClusterClient is returned.3. Otherwise, a single-node Client is returned.
Example (Cluster)¶
rdb := redis.NewUniversalClient(&redis.UniversalOptions{Addrs: []string{":7000", ":7001", ":7002", ":7003", ":7004", ":7005"},})defer rdb.Close()rdb.Ping(ctx)Example (Failover)¶
rdb := redis.NewUniversalClient(&redis.UniversalOptions{MasterName: "master",Addrs: []string{":26379"},})defer rdb.Close()rdb.Ping(ctx)Example (Simple)¶
rdb := redis.NewUniversalClient(&redis.UniversalOptions{Addrs: []string{":6379"},})defer rdb.Close()rdb.Ping(ctx)typeUniversalOptions¶
type UniversalOptions struct {// Either a single address or a seed list of host:port addresses// of cluster/sentinel nodes.Addrs []string// Database to be selected after connecting to the server.// Only single-node and failover clients.DBintDialer func(ctxcontext.Context, network, addrstring) (net.Conn,error)OnConnect func(ctxcontext.Context, cn *Conn)errorUsernamestringPasswordstringSentinelUsernamestringSentinelPasswordstringMaxRetriesintMinRetryBackofftime.DurationMaxRetryBackofftime.DurationDialTimeouttime.DurationReadTimeouttime.DurationWriteTimeouttime.Duration// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).PoolFIFOboolPoolSizeintMinIdleConnsintMaxConnAgetime.DurationPoolTimeouttime.DurationIdleTimeouttime.DurationIdleCheckFrequencytime.DurationTLSConfig *tls.ConfigMaxRedirectsintReadOnlyboolRouteByLatencyboolRouteRandomlyboolMasterNamestring}UniversalOptions information is required by UniversalClient to establishconnections.
func (*UniversalOptions)Cluster¶
func (o *UniversalOptions) Cluster() *ClusterOptions
Cluster returns cluster options created from the universal options.
func (*UniversalOptions)Failover¶
func (o *UniversalOptions) Failover() *FailoverOptions
Failover returns failover options created from the universal options.
func (*UniversalOptions)Simple¶
func (o *UniversalOptions) Simple() *Options
Simple returns basic options created from the universal options.
typeXAddArgs¶
type XAddArgs struct {StreamstringNoMkStreamboolMaxLenint64// MAXLEN N// Deprecated: use MaxLen+Approx, remove in v9.MaxLenApproxint64// MAXLEN ~ NMinIDstring// Approx causes MaxLen and MinID to use "~" matcher (instead of "=").ApproxboolLimitint64IDstringValues interface{}}XAddArgs accepts values in the following formats:
- XAddArgs.Values = []interface{}{"key1", "value1", "key2", "value2"}
- XAddArgs.Values = []string("key1", "value1", "key2", "value2")
- XAddArgs.Values = map[string]interface{}{"key1": "value1", "key2": "value2"}
Note that map will not preserve the order of key-value pairs.MaxLen/MaxLenApprox and MinID are in conflict, only one of them can be used.
typeXAutoClaimArgs¶added inv8.11.0
typeXAutoClaimCmd¶added inv8.11.0
type XAutoClaimCmd struct {// contains filtered or unexported fields}funcNewXAutoClaimCmd¶added inv8.11.0
func NewXAutoClaimCmd(ctxcontext.Context, args ...interface{}) *XAutoClaimCmd
func (*XAutoClaimCmd)Result¶added inv8.11.0
func (cmd *XAutoClaimCmd) Result() (messages []XMessage, startstring, errerror)
func (*XAutoClaimCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *XAutoClaimCmd) SetFirstKeyPos(keyPosint8)
func (*XAutoClaimCmd)SetVal¶added inv8.11.4
func (cmd *XAutoClaimCmd) SetVal(val []XMessage, startstring)
func (*XAutoClaimCmd)String¶added inv8.11.0
func (cmd *XAutoClaimCmd) String()string
func (*XAutoClaimCmd)Val¶added inv8.11.0
func (cmd *XAutoClaimCmd) Val() (messages []XMessage, startstring)
typeXAutoClaimJustIDCmd¶added inv8.11.0
type XAutoClaimJustIDCmd struct {// contains filtered or unexported fields}funcNewXAutoClaimJustIDCmd¶added inv8.11.0
func NewXAutoClaimJustIDCmd(ctxcontext.Context, args ...interface{}) *XAutoClaimJustIDCmd
func (*XAutoClaimJustIDCmd)Result¶added inv8.11.0
func (cmd *XAutoClaimJustIDCmd) Result() (ids []string, startstring, errerror)
func (*XAutoClaimJustIDCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *XAutoClaimJustIDCmd) SetFirstKeyPos(keyPosint8)
func (*XAutoClaimJustIDCmd)SetVal¶added inv8.11.4
func (cmd *XAutoClaimJustIDCmd) SetVal(val []string, startstring)
func (*XAutoClaimJustIDCmd)String¶added inv8.11.0
func (cmd *XAutoClaimJustIDCmd) String()string
func (*XAutoClaimJustIDCmd)Val¶added inv8.11.0
func (cmd *XAutoClaimJustIDCmd) Val() (ids []string, startstring)
typeXClaimArgs¶
typeXInfoConsumer¶added inv8.6.0
typeXInfoConsumersCmd¶added inv8.6.0
type XInfoConsumersCmd struct {// contains filtered or unexported fields}funcNewXInfoConsumersCmd¶added inv8.6.0
func NewXInfoConsumersCmd(ctxcontext.Context, streamstring, groupstring) *XInfoConsumersCmd
func (*XInfoConsumersCmd)Result¶added inv8.6.0
func (cmd *XInfoConsumersCmd) Result() ([]XInfoConsumer,error)
func (*XInfoConsumersCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *XInfoConsumersCmd) SetFirstKeyPos(keyPosint8)
func (*XInfoConsumersCmd)SetVal¶added inv8.11.4
func (cmd *XInfoConsumersCmd) SetVal(val []XInfoConsumer)
func (*XInfoConsumersCmd)String¶added inv8.6.0
func (cmd *XInfoConsumersCmd) String()string
func (*XInfoConsumersCmd)Val¶added inv8.6.0
func (cmd *XInfoConsumersCmd) Val() []XInfoConsumer
typeXInfoGroup¶added inv8.2.0
typeXInfoGroupsCmd¶
type XInfoGroupsCmd struct {// contains filtered or unexported fields}funcNewXInfoGroupsCmd¶
func NewXInfoGroupsCmd(ctxcontext.Context, streamstring) *XInfoGroupsCmd
func (*XInfoGroupsCmd)Result¶
func (cmd *XInfoGroupsCmd) Result() ([]XInfoGroup,error)
func (*XInfoGroupsCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *XInfoGroupsCmd) SetFirstKeyPos(keyPosint8)
func (*XInfoGroupsCmd)SetVal¶added inv8.11.4
func (cmd *XInfoGroupsCmd) SetVal(val []XInfoGroup)
func (*XInfoGroupsCmd)String¶
func (cmd *XInfoGroupsCmd) String()string
func (*XInfoGroupsCmd)Val¶
func (cmd *XInfoGroupsCmd) Val() []XInfoGroup
typeXInfoStream¶added inv8.2.1
typeXInfoStreamCmd¶added inv8.2.1
type XInfoStreamCmd struct {// contains filtered or unexported fields}funcNewXInfoStreamCmd¶added inv8.2.1
func NewXInfoStreamCmd(ctxcontext.Context, streamstring) *XInfoStreamCmd
func (*XInfoStreamCmd)Result¶added inv8.2.1
func (cmd *XInfoStreamCmd) Result() (*XInfoStream,error)
func (*XInfoStreamCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *XInfoStreamCmd) SetFirstKeyPos(keyPosint8)
func (*XInfoStreamCmd)SetVal¶added inv8.11.4
func (cmd *XInfoStreamCmd) SetVal(val *XInfoStream)
func (*XInfoStreamCmd)String¶added inv8.2.1
func (cmd *XInfoStreamCmd) String()string
func (*XInfoStreamCmd)Val¶added inv8.2.1
func (cmd *XInfoStreamCmd) Val() *XInfoStream
typeXInfoStreamConsumer¶added inv8.9.0
type XInfoStreamConsumer struct {NamestringSeenTimetime.TimePelCountint64Pending []XInfoStreamConsumerPending}typeXInfoStreamConsumerPending¶added inv8.9.0
typeXInfoStreamFull¶added inv8.9.0
typeXInfoStreamFullCmd¶added inv8.9.0
type XInfoStreamFullCmd struct {// contains filtered or unexported fields}funcNewXInfoStreamFullCmd¶added inv8.9.0
func NewXInfoStreamFullCmd(ctxcontext.Context, args ...interface{}) *XInfoStreamFullCmd
func (*XInfoStreamFullCmd)Result¶added inv8.9.0
func (cmd *XInfoStreamFullCmd) Result() (*XInfoStreamFull,error)
func (*XInfoStreamFullCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *XInfoStreamFullCmd) SetFirstKeyPos(keyPosint8)
func (*XInfoStreamFullCmd)SetVal¶added inv8.11.4
func (cmd *XInfoStreamFullCmd) SetVal(val *XInfoStreamFull)
func (*XInfoStreamFullCmd)String¶added inv8.9.0
func (cmd *XInfoStreamFullCmd) String()string
func (*XInfoStreamFullCmd)Val¶added inv8.9.0
func (cmd *XInfoStreamFullCmd) Val() *XInfoStreamFull
typeXInfoStreamGroup¶added inv8.9.0
type XInfoStreamGroup struct {NamestringLastDeliveredIDstringPelCountint64Pending []XInfoStreamGroupPendingConsumers []XInfoStreamConsumer}typeXInfoStreamGroupPending¶added inv8.9.0
typeXMessageSliceCmd¶
type XMessageSliceCmd struct {// contains filtered or unexported fields}funcNewXMessageSliceCmd¶
func NewXMessageSliceCmd(ctxcontext.Context, args ...interface{}) *XMessageSliceCmd
funcNewXMessageSliceCmdResult¶
func NewXMessageSliceCmdResult(val []XMessage, errerror) *XMessageSliceCmd
NewXMessageSliceCmdResult returns a XMessageSliceCmd initialised with val and err for testing.
func (*XMessageSliceCmd)Result¶
func (cmd *XMessageSliceCmd) Result() ([]XMessage,error)
func (*XMessageSliceCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *XMessageSliceCmd) SetFirstKeyPos(keyPosint8)
func (*XMessageSliceCmd)SetVal¶added inv8.11.4
func (cmd *XMessageSliceCmd) SetVal(val []XMessage)
func (*XMessageSliceCmd)String¶
func (cmd *XMessageSliceCmd) String()string
func (*XMessageSliceCmd)Val¶
func (cmd *XMessageSliceCmd) Val() []XMessage
typeXPendingCmd¶
type XPendingCmd struct {// contains filtered or unexported fields}funcNewXPendingCmd¶
func NewXPendingCmd(ctxcontext.Context, args ...interface{}) *XPendingCmd
func (*XPendingCmd)Result¶
func (cmd *XPendingCmd) Result() (*XPending,error)
func (*XPendingCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *XPendingCmd) SetFirstKeyPos(keyPosint8)
func (*XPendingCmd)SetVal¶added inv8.11.4
func (cmd *XPendingCmd) SetVal(val *XPending)
func (*XPendingCmd)String¶
func (cmd *XPendingCmd) String()string
func (*XPendingCmd)Val¶
func (cmd *XPendingCmd) Val() *XPending
typeXPendingExtArgs¶
typeXPendingExtCmd¶
type XPendingExtCmd struct {// contains filtered or unexported fields}funcNewXPendingExtCmd¶
func NewXPendingExtCmd(ctxcontext.Context, args ...interface{}) *XPendingExtCmd
func (*XPendingExtCmd)Result¶
func (cmd *XPendingExtCmd) Result() ([]XPendingExt,error)
func (*XPendingExtCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *XPendingExtCmd) SetFirstKeyPos(keyPosint8)
func (*XPendingExtCmd)SetVal¶added inv8.11.4
func (cmd *XPendingExtCmd) SetVal(val []XPendingExt)
func (*XPendingExtCmd)String¶
func (cmd *XPendingExtCmd) String()string
func (*XPendingExtCmd)Val¶
func (cmd *XPendingExtCmd) Val() []XPendingExt
typeXReadGroupArgs¶
typeXStreamSliceCmd¶
type XStreamSliceCmd struct {// contains filtered or unexported fields}funcNewXStreamSliceCmd¶
func NewXStreamSliceCmd(ctxcontext.Context, args ...interface{}) *XStreamSliceCmd
funcNewXStreamSliceCmdResult¶
func NewXStreamSliceCmdResult(val []XStream, errerror) *XStreamSliceCmd
NewXStreamSliceCmdResult returns a XStreamSliceCmd initialised with val and err for testing.
func (*XStreamSliceCmd)Result¶
func (cmd *XStreamSliceCmd) Result() ([]XStream,error)
func (*XStreamSliceCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *XStreamSliceCmd) SetFirstKeyPos(keyPosint8)
func (*XStreamSliceCmd)SetVal¶added inv8.11.4
func (cmd *XStreamSliceCmd) SetVal(val []XStream)
func (*XStreamSliceCmd)String¶
func (cmd *XStreamSliceCmd) String()string
func (*XStreamSliceCmd)Val¶
func (cmd *XStreamSliceCmd) Val() []XStream
typeZRangeArgs¶added inv8.11.0
type ZRangeArgs struct {Keystring// When the ByScore option is provided, the open interval(exclusive) can be set.// By default, the score intervals specified by <Start> and <Stop> are closed (inclusive).// It is similar to the deprecated(6.2.0+) ZRangeByScore command.// For example://ZRangeArgs{//Key: "example-key",// Start: "(3",// Stop: 8,//ByScore:true,// }// cmd: "ZRange example-key (3 8 ByScore" (3 < score <= 8).//// For the ByLex option, it is similar to the deprecated(6.2.0+) ZRangeByLex command.// You can set the <Start> and <Stop> options as follows://ZRangeArgs{//Key: "example-key",// Start: "[abc",// Stop: "(def",//ByLex:true,// }//cmd: "ZRange example-key [abc (def ByLex"//// For normal cases (ByScore==false && ByLex==false), <Start> and <Stop> should be set to the index range (int).// You can read the documentation for more information:https://redis.io/commands/zrangeStart interface{}Stop interface{}// The ByScore and ByLex options are mutually exclusive.ByScoreboolByLexboolRevbool// limit offset count.Offsetint64Countint64}ZRangeArgs is all the options of the ZRange command.In version> 6.2.0, you can replace the(cmd):
ZREVRANGE,ZRANGEBYSCORE,ZREVRANGEBYSCORE,ZRANGEBYLEX,ZREVRANGEBYLEX.
Please pay attention to your redis-server version.
Rev, ByScore, ByLex and Offset+Count options require redis-server 6.2.0 and higher.
typeZSliceCmd¶
type ZSliceCmd struct {// contains filtered or unexported fields}funcNewZSliceCmd¶
funcNewZSliceCmdResult¶
NewZSliceCmdResult returns a ZSliceCmd initialised with val and err for testing.
func (*ZSliceCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *ZSliceCmd) SetFirstKeyPos(keyPosint8)
typeZWithKey¶
ZWithKey represents sorted set member including the name of the key where it was popped.
typeZWithKeyCmd¶
type ZWithKeyCmd struct {// contains filtered or unexported fields}funcNewZWithKeyCmd¶
func NewZWithKeyCmd(ctxcontext.Context, args ...interface{}) *ZWithKeyCmd
funcNewZWithKeyCmdResult¶
func NewZWithKeyCmdResult(val *ZWithKey, errerror) *ZWithKeyCmd
NewZWithKeyCmdResult returns a NewZWithKeyCmd initialised with val and err for testing.
func (*ZWithKeyCmd)Result¶
func (cmd *ZWithKeyCmd) Result() (*ZWithKey,error)
func (*ZWithKeyCmd)SetFirstKeyPos¶added inv8.11.5
func (cmd *ZWithKeyCmd) SetFirstKeyPos(keyPosint8)
func (*ZWithKeyCmd)SetVal¶added inv8.11.4
func (cmd *ZWithKeyCmd) SetVal(val *ZWithKey)
func (*ZWithKeyCmd)String¶
func (cmd *ZWithKeyCmd) String()string
func (*ZWithKeyCmd)Val¶
func (cmd *ZWithKeyCmd) Val() *ZWithKey