redis.v3: gopkg.in/redis.v3 Index | Examples | Files | Directories

package redis

import "gopkg.in/redis.v3"

Package redis implements a Redis client.

Code:

Get := func(client *redis.Client, key string) *redis.StringCmd {
    cmd := redis.NewStringCmd("GET", key)
    client.Process(cmd)
    return cmd
}

v, err := Get(client, "key_does_not_exist").Result()
fmt.Printf("%q %s", v, err)

Output:

"" redis: nil

Index

Examples

Package Files

cluster.go cluster_pipeline.go command.go commands.go doc.go error.go multi.go options.go parser.go pipeline.go pubsub.go redis.go ring.go script.go sentinel.go unsafe.go

Variables

var Logger *log.Logger
var Nil = errorf("redis: nil")

Redis nil reply, .e.g. when key does not exist.

var TxFailedErr = errorf("redis: transaction failed")

Redis transaction failed.

func SetLogger Uses

func SetLogger(logger *log.Logger)

type BitCount Uses

type BitCount struct {
    Start, End int64
}

type BoolCmd Uses

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

func NewBoolCmd Uses

func NewBoolCmd(args ...interface{}) *BoolCmd

func (*BoolCmd) Err Uses

func (cmd *BoolCmd) Err() error

func (*BoolCmd) Result Uses

func (cmd *BoolCmd) Result() (bool, error)

func (*BoolCmd) String Uses

func (cmd *BoolCmd) String() string

func (*BoolCmd) Val Uses

func (cmd *BoolCmd) Val() bool

type BoolSliceCmd Uses

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

func NewBoolSliceCmd Uses

func NewBoolSliceCmd(args ...interface{}) *BoolSliceCmd

func (*BoolSliceCmd) Err Uses

func (cmd *BoolSliceCmd) Err() error

func (*BoolSliceCmd) Result Uses

func (cmd *BoolSliceCmd) Result() ([]bool, error)

func (*BoolSliceCmd) String Uses

func (cmd *BoolSliceCmd) String() string

func (*BoolSliceCmd) Val Uses

func (cmd *BoolSliceCmd) Val() []bool

type Client Uses

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

Client is a Redis client representing a pool of zero or more underlying connections. It's safe for concurrent use by multiple goroutines.

Code:

err := client.Set("key", "value", 0).Err()
if err != nil {
    panic(err)
}

val, err := client.Get("key").Result()
if err != nil {
    panic(err)
}
fmt.Println("key", val)

val2, err := client.Get("key2").Result()
if err == redis.Nil {
    fmt.Println("key2 does not exists")
} else if err != nil {
    panic(err)
} else {
    fmt.Println("key2", val2)
}

Output:

key value
key2 does not exists

func NewClient Uses

func NewClient(opt *Options) *Client

NewClient returns a client to the Redis Server specified by Options.

Code:

client := redis.NewClient(&redis.Options{
    Addr:     "localhost:6379",
    Password: "", // no password set
    DB:       0,  // use default DB
})

pong, err := client.Ping().Result()
fmt.Println(pong, err)

Output:

PONG <nil>

func NewFailoverClient Uses

func NewFailoverClient(failoverOpt *FailoverOptions) *Client

NewFailoverClient returns a Redis client that uses Redis Sentinel for automatic failover. It's safe for concurrent use by multiple goroutines.

Code:

// See http://redis.io/topics/sentinel for instructions how to
// setup Redis Sentinel.
client := redis.NewFailoverClient(&redis.FailoverOptions{
    MasterName:    "master",
    SentinelAddrs: []string{":26379"},
})
client.Ping()

func (*Client) Append Uses

func (c *Client) Append(key, value string) *IntCmd

func (*Client) Auth Uses

func (c *Client) Auth(password string) *StatusCmd

func (*Client) BLPop Uses

func (c *Client) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd

Code:

if err := client.RPush("queue", "message").Err(); err != nil {
    panic(err)
}

// use `client.BLPop(0, "queue")` for infinite waiting time
result, err := client.BLPop(1*time.Second, "queue").Result()
if err != nil {
    panic(err)
}

fmt.Println(result[0], result[1])

Output:

queue message

func (*Client) BRPop Uses

func (c *Client) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd

func (*Client) BRPopLPush Uses

func (c *Client) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd

func (*Client) BgRewriteAOF Uses

func (c *Client) BgRewriteAOF() *StatusCmd

func (*Client) BgSave Uses

func (c *Client) BgSave() *StatusCmd

func (*Client) BitCount Uses

func (c *Client) BitCount(key string, bitCount *BitCount) *IntCmd

func (*Client) BitOpAnd Uses

func (c *Client) BitOpAnd(destKey string, keys ...string) *IntCmd

func (*Client) BitOpNot Uses

func (c *Client) BitOpNot(destKey string, key string) *IntCmd

func (*Client) BitOpOr Uses

func (c *Client) BitOpOr(destKey string, keys ...string) *IntCmd

func (*Client) BitOpXor Uses

func (c *Client) BitOpXor(destKey string, keys ...string) *IntCmd

func (*Client) BitPos Uses

func (c *Client) BitPos(key string, bit int64, pos ...int64) *IntCmd

func (*Client) ClientGetName Uses

func (c *Client) ClientGetName() *StringCmd

ClientGetName returns the name of the one of many connections in the pool.

func (*Client) ClientKill Uses

func (c *Client) ClientKill(ipPort string) *StatusCmd

func (*Client) ClientList Uses

func (c *Client) ClientList() *StringCmd

func (*Client) ClientPause Uses

func (c *Client) ClientPause(dur time.Duration) *BoolCmd

func (*Client) ClientSetName Uses

func (c *Client) ClientSetName(name string) *BoolCmd

ClientSetName assigns a name to the one of many connections in the pool.

func (*Client) Close Uses

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 be long-lived and shared between many goroutines.

func (*Client) ClusterAddSlots Uses

func (c *Client) ClusterAddSlots(slots ...int) *StatusCmd

func (*Client) ClusterAddSlotsRange Uses

func (c *Client) ClusterAddSlotsRange(min, max int) *StatusCmd

func (*Client) ClusterCountFailureReports Uses

func (c *Client) ClusterCountFailureReports(nodeID string) *IntCmd

func (*Client) ClusterCountKeysInSlot Uses

func (c *Client) ClusterCountKeysInSlot(slot int) *IntCmd

func (*Client) ClusterDelSlots Uses

func (c *Client) ClusterDelSlots(slots ...int) *StatusCmd

func (*Client) ClusterDelSlotsRange Uses

func (c *Client) ClusterDelSlotsRange(min, max int) *StatusCmd

func (*Client) ClusterFailover Uses

func (c *Client) ClusterFailover() *StatusCmd

func (*Client) ClusterForget Uses

func (c *Client) ClusterForget(nodeID string) *StatusCmd

func (*Client) ClusterInfo Uses

func (c *Client) ClusterInfo() *StringCmd

func (*Client) ClusterKeySlot Uses

func (c *Client) ClusterKeySlot(key string) *IntCmd

func (*Client) ClusterMeet Uses

func (c *Client) ClusterMeet(host, port string) *StatusCmd

func (*Client) ClusterNodes Uses

func (c *Client) ClusterNodes() *StringCmd

func (*Client) ClusterReplicate Uses

func (c *Client) ClusterReplicate(nodeID string) *StatusCmd

func (*Client) ClusterResetHard Uses

func (c *Client) ClusterResetHard() *StatusCmd

func (*Client) ClusterResetSoft Uses

func (c *Client) ClusterResetSoft() *StatusCmd

func (*Client) ClusterSaveConfig Uses

func (c *Client) ClusterSaveConfig() *StatusCmd

func (*Client) ClusterSlaves Uses

func (c *Client) ClusterSlaves(nodeID string) *StringSliceCmd

func (*Client) ClusterSlots Uses

func (c *Client) ClusterSlots() *ClusterSlotCmd

func (*Client) ConfigGet Uses

func (c *Client) ConfigGet(parameter string) *SliceCmd

func (*Client) ConfigResetStat Uses

func (c *Client) ConfigResetStat() *StatusCmd

func (*Client) ConfigSet Uses

func (c *Client) ConfigSet(parameter, value string) *StatusCmd

func (*Client) DbSize Uses

func (c *Client) DbSize() *IntCmd

func (*Client) DebugObject Uses

func (c *Client) DebugObject(key string) *StringCmd

func (*Client) Decr Uses

func (c *Client) Decr(key string) *IntCmd

func (*Client) DecrBy Uses

func (c *Client) DecrBy(key string, decrement int64) *IntCmd

func (*Client) Del Uses

func (c *Client) Del(keys ...string) *IntCmd

func (*Client) Dump Uses

func (c *Client) Dump(key string) *StringCmd

func (*Client) Echo Uses

func (c *Client) Echo(message string) *StringCmd

func (*Client) Eval Uses

func (c *Client) Eval(script string, keys []string, args []string) *Cmd

func (*Client) EvalSha Uses

func (c *Client) EvalSha(sha1 string, keys []string, args []string) *Cmd

func (*Client) Exists Uses

func (c *Client) Exists(key string) *BoolCmd

func (*Client) Expire Uses

func (c *Client) Expire(key string, expiration time.Duration) *BoolCmd

func (*Client) ExpireAt Uses

func (c *Client) ExpireAt(key string, tm time.Time) *BoolCmd

func (*Client) FlushAll Uses

func (c *Client) FlushAll() *StatusCmd

func (*Client) FlushDb Uses

func (c *Client) FlushDb() *StatusCmd

func (*Client) GeoAdd Uses

func (c *Client) GeoAdd(key string, geoLocation ...*GeoLocation) *IntCmd

func (*Client) GeoDist Uses

func (c *Client) GeoDist(key string, member1, member2, unit string) *FloatCmd

func (*Client) GeoHash Uses

func (c *Client) GeoHash(key string, members ...string) *StringSliceCmd

func (*Client) GeoRadius Uses

func (c *Client) GeoRadius(key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd

func (*Client) GeoRadiusByMember Uses

func (c *Client) GeoRadiusByMember(key, member string, query *GeoRadiusQuery) *GeoLocationCmd

func (*Client) Get Uses

func (c *Client) Get(key string) *StringCmd

func (*Client) GetBit Uses

func (c *Client) GetBit(key string, offset int64) *IntCmd

func (*Client) GetRange Uses

func (c *Client) GetRange(key string, start, end int64) *StringCmd

func (*Client) GetSet Uses

func (c *Client) GetSet(key string, value interface{}) *StringCmd

func (*Client) HDel Uses

func (c *Client) HDel(key string, fields ...string) *IntCmd

func (*Client) HExists Uses

func (c *Client) HExists(key, field string) *BoolCmd

func (*Client) HGet Uses

func (c *Client) HGet(key, field string) *StringCmd

func (*Client) HGetAll Uses

func (c *Client) HGetAll(key string) *StringSliceCmd

func (*Client) HGetAllMap Uses

func (c *Client) HGetAllMap(key string) *StringStringMapCmd

func (*Client) HIncrBy Uses

func (c *Client) HIncrBy(key, field string, incr int64) *IntCmd

func (*Client) HIncrByFloat Uses

func (c *Client) HIncrByFloat(key, field string, incr float64) *FloatCmd

func (*Client) HKeys Uses

func (c *Client) HKeys(key string) *StringSliceCmd

func (*Client) HLen Uses

func (c *Client) HLen(key string) *IntCmd

func (*Client) HMGet Uses

func (c *Client) HMGet(key string, fields ...string) *SliceCmd

func (*Client) HMSet Uses

func (c *Client) HMSet(key, field, value string, pairs ...string) *StatusCmd

func (*Client) HMSetMap Uses

func (c *Client) HMSetMap(key string, fields map[string]string) *StatusCmd

func (*Client) HScan Uses

func (c *Client) HScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*Client) HSet Uses

func (c *Client) HSet(key, field, value string) *BoolCmd

func (*Client) HSetNX Uses

func (c *Client) HSetNX(key, field, value string) *BoolCmd

func (*Client) HVals Uses

func (c *Client) HVals(key string) *StringSliceCmd

func (*Client) Incr Uses

func (c *Client) Incr(key string) *IntCmd

Code:

if err := client.Incr("counter").Err(); err != nil {
    panic(err)
}

n, err := client.Get("counter").Int64()
fmt.Println(n, err)

Output:

1 <nil>

func (*Client) IncrBy Uses

func (c *Client) IncrBy(key string, value int64) *IntCmd

func (*Client) IncrByFloat Uses

func (c *Client) IncrByFloat(key string, value float64) *FloatCmd

func (*Client) Info Uses

func (c *Client) Info(section ...string) *StringCmd

func (*Client) Keys Uses

func (c *Client) Keys(pattern string) *StringSliceCmd

func (*Client) LIndex Uses

func (c *Client) LIndex(key string, index int64) *StringCmd

func (*Client) LInsert Uses

func (c *Client) LInsert(key, op, pivot, value string) *IntCmd

func (*Client) LLen Uses

func (c *Client) LLen(key string) *IntCmd

func (*Client) LPop Uses

func (c *Client) LPop(key string) *StringCmd

func (*Client) LPush Uses

func (c *Client) LPush(key string, values ...string) *IntCmd

func (*Client) LPushX Uses

func (c *Client) LPushX(key, value interface{}) *IntCmd

func (*Client) LRange Uses

func (c *Client) LRange(key string, start, stop int64) *StringSliceCmd

func (*Client) LRem Uses

func (c *Client) LRem(key string, count int64, value interface{}) *IntCmd

func (*Client) LSet Uses

func (c *Client) LSet(key string, index int64, value interface{}) *StatusCmd

func (*Client) LTrim Uses

func (c *Client) LTrim(key string, start, stop int64) *StatusCmd

func (*Client) LastSave Uses

func (c *Client) LastSave() *IntCmd

func (*Client) MGet Uses

func (c *Client) MGet(keys ...string) *SliceCmd

func (*Client) MSet Uses

func (c *Client) MSet(pairs ...string) *StatusCmd

func (*Client) MSetNX Uses

func (c *Client) MSetNX(pairs ...string) *BoolCmd

func (*Client) Migrate Uses

func (c *Client) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd

func (*Client) Move Uses

func (c *Client) Move(key string, db int64) *BoolCmd

func (*Client) Multi Uses

func (c *Client) Multi() *Multi

Deprecated. Use Watch instead.

func (*Client) ObjectEncoding Uses

func (c *Client) ObjectEncoding(keys ...string) *StringCmd

func (*Client) ObjectIdleTime Uses

func (c *Client) ObjectIdleTime(keys ...string) *DurationCmd

func (*Client) ObjectRefCount Uses

func (c *Client) ObjectRefCount(keys ...string) *IntCmd

func (*Client) PExpire Uses

func (c *Client) PExpire(key string, expiration time.Duration) *BoolCmd

func (*Client) PExpireAt Uses

func (c *Client) PExpireAt(key string, tm time.Time) *BoolCmd

func (*Client) PFAdd Uses

func (c *Client) PFAdd(key string, fields ...string) *IntCmd

func (*Client) PFCount Uses

func (c *Client) PFCount(keys ...string) *IntCmd

func (*Client) PFMerge Uses

func (c *Client) PFMerge(dest string, keys ...string) *StatusCmd

func (*Client) PSubscribe Uses

func (c *Client) PSubscribe(channels ...string) (*PubSub, error)

Subscribes the client to the given patterns.

func (*Client) PTTL Uses

func (c *Client) PTTL(key string) *DurationCmd

func (*Client) Persist Uses

func (c *Client) Persist(key string) *BoolCmd

func (*Client) Ping Uses

func (c *Client) Ping() *StatusCmd

func (*Client) Pipeline Uses

func (c *Client) Pipeline() *Pipeline

func (*Client) Pipelined Uses

func (c *Client) Pipelined(fn func(*Pipeline) error) ([]Cmder, error)

Code:

var incr *redis.IntCmd
_, err := client.Pipelined(func(pipe *redis.Pipeline) error {
    incr = pipe.Incr("counter1")
    pipe.Expire("counter1", time.Hour)
    return nil
})
fmt.Println(incr.Val(), err)

Output:

1 <nil>

func (*Client) PoolStats Uses

func (c *Client) PoolStats() *PoolStats

PoolStats returns connection pool stats.

func (*Client) Process Uses

func (c *Client) Process(cmd Cmder)

func (*Client) PubSub Uses

func (c *Client) PubSub() *PubSub

Deprecated. Use Subscribe/PSubscribe instead.

func (*Client) PubSubChannels Uses

func (c *Client) PubSubChannels(pattern string) *StringSliceCmd

func (*Client) PubSubNumPat Uses

func (c *Client) PubSubNumPat() *IntCmd

func (*Client) PubSubNumSub Uses

func (c *Client) PubSubNumSub(channels ...string) *StringIntMapCmd

func (*Client) Publish Uses

func (c *Client) Publish(channel, message string) *IntCmd

Posts a message to the given channel.

func (*Client) Quit Uses

func (c *Client) Quit() *StatusCmd

func (*Client) RPop Uses

func (c *Client) RPop(key string) *StringCmd

func (*Client) RPopLPush Uses

func (c *Client) RPopLPush(source, destination string) *StringCmd

func (*Client) RPush Uses

func (c *Client) RPush(key string, values ...string) *IntCmd

func (*Client) RPushX Uses

func (c *Client) RPushX(key string, value interface{}) *IntCmd

func (*Client) RandomKey Uses

func (c *Client) RandomKey() *StringCmd

func (*Client) ReadWrite Uses

func (c *Client) ReadWrite() *StatusCmd

func (*Client) Readonly Uses

func (c *Client) Readonly() *StatusCmd

func (*Client) Rename Uses

func (c *Client) Rename(key, newkey string) *StatusCmd

func (*Client) RenameNX Uses

func (c *Client) RenameNX(key, newkey string) *BoolCmd

func (*Client) Restore Uses

func (c *Client) Restore(key string, ttl time.Duration, value string) *StatusCmd

func (*Client) RestoreReplace Uses

func (c *Client) RestoreReplace(key string, ttl time.Duration, value string) *StatusCmd

func (*Client) SAdd Uses

func (c *Client) SAdd(key string, members ...string) *IntCmd

func (*Client) SCard Uses

func (c *Client) SCard(key string) *IntCmd

func (*Client) SDiff Uses

func (c *Client) SDiff(keys ...string) *StringSliceCmd

func (*Client) SDiffStore Uses

func (c *Client) SDiffStore(destination string, keys ...string) *IntCmd

func (*Client) SInter Uses

func (c *Client) SInter(keys ...string) *StringSliceCmd

func (*Client) SInterStore Uses

func (c *Client) SInterStore(destination string, keys ...string) *IntCmd

func (*Client) SIsMember Uses

func (c *Client) SIsMember(key string, member interface{}) *BoolCmd

func (*Client) SMembers Uses

func (c *Client) SMembers(key string) *StringSliceCmd

func (*Client) SMove Uses

func (c *Client) SMove(source, destination string, member interface{}) *BoolCmd

func (*Client) SPop Uses

func (c *Client) SPop(key string) *StringCmd

Redis `SPOP key` command.

func (*Client) SPopN Uses

func (c *Client) SPopN(key string, count int64) *StringSliceCmd

Redis `SPOP key count` command.

func (*Client) SRandMember Uses

func (c *Client) SRandMember(key string) *StringCmd

Redis `SRANDMEMBER key` command.

func (*Client) SRandMemberN Uses

func (c *Client) SRandMemberN(key string, count int64) *StringSliceCmd

Redis `SRANDMEMBER key count` command.

func (*Client) SRem Uses

func (c *Client) SRem(key string, members ...string) *IntCmd

func (*Client) SScan Uses

func (c *Client) SScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*Client) SUnion Uses

func (c *Client) SUnion(keys ...string) *StringSliceCmd

func (*Client) SUnionStore Uses

func (c *Client) SUnionStore(destination string, keys ...string) *IntCmd

func (*Client) Save Uses

func (c *Client) Save() *StatusCmd

func (*Client) Scan Uses

func (c *Client) Scan(cursor int64, match string, count int64) *ScanCmd

Code:

client.FlushDb()
for i := 0; i < 33; i++ {
    err := client.Set(fmt.Sprintf("key%d", i), "value", 0).Err()
    if err != nil {
        panic(err)
    }
}

var cursor int64
var n int
for {
    var keys []string
    var err error
    cursor, keys, err = client.Scan(cursor, "", 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) ScriptExists Uses

func (c *Client) ScriptExists(scripts ...string) *BoolSliceCmd

func (*Client) ScriptFlush Uses

func (c *Client) ScriptFlush() *StatusCmd

func (*Client) ScriptKill Uses

func (c *Client) ScriptKill() *StatusCmd

func (*Client) ScriptLoad Uses

func (c *Client) ScriptLoad(script string) *StringCmd

func (*Client) Select Uses

func (c *Client) Select(index int64) *StatusCmd

func (*Client) Set Uses

func (c *Client) Set(key string, value interface{}, expiration time.Duration) *StatusCmd

Redis `SET key value [expiration]` command.

Zero expiration means the key has no expiration time.

Code:

// Last argument is expiration. Zero means the key has no
// expiration time.
err := client.Set("key", "value", 0).Err()
if err != nil {
    panic(err)
}

// key2 will expire in an hour.
err = client.Set("key2", "value", time.Hour).Err()
if err != nil {
    panic(err)
}

func (*Client) SetBit Uses

func (c *Client) SetBit(key string, offset int64, value int) *IntCmd

func (*Client) SetNX Uses

func (c *Client) SetNX(key string, value interface{}, expiration time.Duration) *BoolCmd

Redis `SET key value [expiration] NX` command.

Zero expiration means the key has no expiration time.

func (*Client) SetRange Uses

func (c *Client) SetRange(key string, offset int64, value string) *IntCmd

func (*Client) SetXX Uses

func (c *Client) SetXX(key string, value interface{}, expiration time.Duration) *BoolCmd

Redis `SET key value [expiration] XX` command.

Zero expiration means the key has no expiration time.

func (*Client) Shutdown Uses

func (c *Client) Shutdown() *StatusCmd

func (*Client) ShutdownNoSave Uses

func (c *Client) ShutdownNoSave() *StatusCmd

func (*Client) ShutdownSave Uses

func (c *Client) ShutdownSave() *StatusCmd

func (*Client) SlaveOf Uses

func (c *Client) SlaveOf(host, port string) *StatusCmd

func (*Client) SlowLog Uses

func (c *Client) SlowLog()

func (*Client) Sort Uses

func (c *Client) Sort(key string, sort Sort) *StringSliceCmd

func (*Client) SortInterfaces Uses

func (c *Client) SortInterfaces(key string, sort Sort) *SliceCmd

func (*Client) StrLen Uses

func (c *Client) StrLen(key string) *IntCmd

func (*Client) String Uses

func (c *Client) String() string

func (*Client) Subscribe Uses

func (c *Client) Subscribe(channels ...string) (*PubSub, error)

Subscribes the client to the specified channels.

func (*Client) Sync Uses

func (c *Client) Sync()

func (*Client) TTL Uses

func (c *Client) TTL(key string) *DurationCmd

func (*Client) Time Uses

func (c *Client) Time() *StringSliceCmd

func (*Client) Type Uses

func (c *Client) Type(key string) *StatusCmd

func (*Client) Watch Uses

func (c *Client) Watch(keys ...string) (*Multi, error)

Watch creates new transaction and marks the keys to be watched for conditional execution of a transaction.

Code:

var incr func(string) error

// Transactionally increments key using GET and SET commands.
incr = func(key string) error {
    tx, err := client.Watch(key)
    if err != nil {
        return err
    }
    defer tx.Close()

    n, err := tx.Get(key).Int64()
    if err != nil && err != redis.Nil {
        return err
    }

    _, err = tx.Exec(func() error {
        tx.Set(key, strconv.FormatInt(n+1, 10), 0)
        return nil
    })
    if err == redis.TxFailedErr {
        return incr(key)
    }
    return err
}

var wg sync.WaitGroup
for i := 0; i < 100; i++ {
    wg.Add(1)
    go func() {
        defer wg.Done()

        err := incr("counter3")
        if err != nil {
            panic(err)
        }
    }()
}
wg.Wait()

n, err := client.Get("counter3").Int64()
fmt.Println(n, err)

Output:

100 <nil>

func (*Client) ZAdd Uses

func (c *Client) ZAdd(key string, members ...Z) *IntCmd

Redis `ZADD key score member [score member ...]` command.

func (*Client) ZAddCh Uses

func (c *Client) ZAddCh(key string, members ...Z) *IntCmd

Redis `ZADD key CH score member [score member ...]` command.

func (*Client) ZAddNX Uses

func (c *Client) ZAddNX(key string, members ...Z) *IntCmd

Redis `ZADD key NX score member [score member ...]` command.

func (*Client) ZAddNXCh Uses

func (c *Client) ZAddNXCh(key string, members ...Z) *IntCmd

Redis `ZADD key NX CH score member [score member ...]` command.

func (*Client) ZAddXX Uses

func (c *Client) ZAddXX(key string, members ...Z) *IntCmd

Redis `ZADD key XX score member [score member ...]` command.

func (*Client) ZAddXXCh Uses

func (c *Client) ZAddXXCh(key string, members ...Z) *IntCmd

Redis `ZADD key XX CH score member [score member ...]` command.

func (*Client) ZCard Uses

func (c *Client) ZCard(key string) *IntCmd

func (*Client) ZCount Uses

func (c *Client) ZCount(key, min, max string) *IntCmd

func (*Client) ZIncr Uses

func (c *Client) ZIncr(key string, member Z) *FloatCmd

Redis `ZADD key INCR score member` command.

func (*Client) ZIncrBy Uses

func (c *Client) ZIncrBy(key string, increment float64, member string) *FloatCmd

func (*Client) ZIncrNX Uses

func (c *Client) ZIncrNX(key string, member Z) *FloatCmd

Redis `ZADD key NX INCR score member` command.

func (*Client) ZIncrXX Uses

func (c *Client) ZIncrXX(key string, member Z) *FloatCmd

Redis `ZADD key XX INCR score member` command.

func (*Client) ZInterStore Uses

func (c *Client) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd

func (*Client) ZRange Uses

func (c *Client) ZRange(key string, start, stop int64) *StringSliceCmd

func (*Client) ZRangeByLex Uses

func (c *Client) ZRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd

func (*Client) ZRangeByScore Uses

func (c *Client) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd

func (*Client) ZRangeByScoreWithScores Uses

func (c *Client) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd

func (*Client) ZRangeWithScores Uses

func (c *Client) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd

func (*Client) ZRank Uses

func (c *Client) ZRank(key, member string) *IntCmd

func (*Client) ZRem Uses

func (c *Client) ZRem(key string, members ...string) *IntCmd

func (*Client) ZRemRangeByRank Uses

func (c *Client) ZRemRangeByRank(key string, start, stop int64) *IntCmd

func (*Client) ZRemRangeByScore Uses

func (c *Client) ZRemRangeByScore(key, min, max string) *IntCmd

func (*Client) ZRevRange Uses

func (c *Client) ZRevRange(key string, start, stop int64) *StringSliceCmd

func (*Client) ZRevRangeByLex Uses

func (c *Client) ZRevRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd

func (*Client) ZRevRangeByScore Uses

func (c *Client) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd

func (*Client) ZRevRangeByScoreWithScores Uses

func (c *Client) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd

func (*Client) ZRevRangeWithScores Uses

func (c *Client) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd

func (*Client) ZRevRank Uses

func (c *Client) ZRevRank(key, member string) *IntCmd

func (*Client) ZScan Uses

func (c *Client) ZScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*Client) ZScore Uses

func (c *Client) ZScore(key, member string) *FloatCmd

func (*Client) ZUnionStore Uses

func (c *Client) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd

type ClusterClient Uses

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

ClusterClient is a Redis Cluster client representing a pool of zero or more underlying connections. It's safe for concurrent use by multiple goroutines.

func NewClusterClient Uses

func NewClusterClient(opt *ClusterOptions) *ClusterClient

NewClusterClient returns a Redis Cluster client as described in http://redis.io/topics/cluster-spec.

Code:

// See http://redis.io/topics/cluster-tutorial for instructions
// how to setup Redis Cluster.
client := redis.NewClusterClient(&redis.ClusterOptions{
    Addrs: []string{":7000", ":7001", ":7002", ":7003", ":7004", ":7005"},
})
client.Ping()

func (*ClusterClient) Append Uses

func (c *ClusterClient) Append(key, value string) *IntCmd

func (*ClusterClient) Auth Uses

func (c *ClusterClient) Auth(password string) *StatusCmd

func (*ClusterClient) BLPop Uses

func (c *ClusterClient) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd

func (*ClusterClient) BRPop Uses

func (c *ClusterClient) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd

func (*ClusterClient) BRPopLPush Uses

func (c *ClusterClient) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd

func (*ClusterClient) BgRewriteAOF Uses

func (c *ClusterClient) BgRewriteAOF() *StatusCmd

func (*ClusterClient) BgSave Uses

func (c *ClusterClient) BgSave() *StatusCmd

func (*ClusterClient) BitCount Uses

func (c *ClusterClient) BitCount(key string, bitCount *BitCount) *IntCmd

func (*ClusterClient) BitOpAnd Uses

func (c *ClusterClient) BitOpAnd(destKey string, keys ...string) *IntCmd

func (*ClusterClient) BitOpNot Uses

func (c *ClusterClient) BitOpNot(destKey string, key string) *IntCmd

func (*ClusterClient) BitOpOr Uses

func (c *ClusterClient) BitOpOr(destKey string, keys ...string) *IntCmd

func (*ClusterClient) BitOpXor Uses

func (c *ClusterClient) BitOpXor(destKey string, keys ...string) *IntCmd

func (*ClusterClient) BitPos Uses

func (c *ClusterClient) BitPos(key string, bit int64, pos ...int64) *IntCmd

func (*ClusterClient) ClientKill Uses

func (c *ClusterClient) ClientKill(ipPort string) *StatusCmd

func (*ClusterClient) ClientList Uses

func (c *ClusterClient) ClientList() *StringCmd

func (*ClusterClient) ClientPause Uses

func (c *ClusterClient) ClientPause(dur time.Duration) *BoolCmd

func (*ClusterClient) ClientSetName Uses

func (c *ClusterClient) ClientSetName(name string) *BoolCmd

ClientSetName assigns a name to the one of many connections in the pool.

func (*ClusterClient) Close Uses

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 meant to be long-lived and shared between many goroutines.

func (*ClusterClient) ClusterAddSlots Uses

func (c *ClusterClient) ClusterAddSlots(slots ...int) *StatusCmd

func (*ClusterClient) ClusterAddSlotsRange Uses

func (c *ClusterClient) ClusterAddSlotsRange(min, max int) *StatusCmd

func (*ClusterClient) ClusterCountFailureReports Uses

func (c *ClusterClient) ClusterCountFailureReports(nodeID string) *IntCmd

func (*ClusterClient) ClusterCountKeysInSlot Uses

func (c *ClusterClient) ClusterCountKeysInSlot(slot int) *IntCmd

func (*ClusterClient) ClusterDelSlots Uses

func (c *ClusterClient) ClusterDelSlots(slots ...int) *StatusCmd

func (*ClusterClient) ClusterDelSlotsRange Uses

func (c *ClusterClient) ClusterDelSlotsRange(min, max int) *StatusCmd

func (*ClusterClient) ClusterFailover Uses

func (c *ClusterClient) ClusterFailover() *StatusCmd

func (*ClusterClient) ClusterForget Uses

func (c *ClusterClient) ClusterForget(nodeID string) *StatusCmd

func (*ClusterClient) ClusterInfo Uses

func (c *ClusterClient) ClusterInfo() *StringCmd

func (*ClusterClient) ClusterKeySlot Uses

func (c *ClusterClient) ClusterKeySlot(key string) *IntCmd

func (*ClusterClient) ClusterMeet Uses

func (c *ClusterClient) ClusterMeet(host, port string) *StatusCmd

func (*ClusterClient) ClusterNodes Uses

func (c *ClusterClient) ClusterNodes() *StringCmd

func (*ClusterClient) ClusterReplicate Uses

func (c *ClusterClient) ClusterReplicate(nodeID string) *StatusCmd

func (*ClusterClient) ClusterResetHard Uses

func (c *ClusterClient) ClusterResetHard() *StatusCmd

func (*ClusterClient) ClusterResetSoft Uses

func (c *ClusterClient) ClusterResetSoft() *StatusCmd

func (*ClusterClient) ClusterSaveConfig Uses

func (c *ClusterClient) ClusterSaveConfig() *StatusCmd

func (*ClusterClient) ClusterSlaves Uses

func (c *ClusterClient) ClusterSlaves(nodeID string) *StringSliceCmd

func (*ClusterClient) ClusterSlots Uses

func (c *ClusterClient) ClusterSlots() *ClusterSlotCmd

func (*ClusterClient) ConfigGet Uses

func (c *ClusterClient) ConfigGet(parameter string) *SliceCmd

func (*ClusterClient) ConfigResetStat Uses

func (c *ClusterClient) ConfigResetStat() *StatusCmd

func (*ClusterClient) ConfigSet Uses

func (c *ClusterClient) ConfigSet(parameter, value string) *StatusCmd

func (*ClusterClient) DbSize Uses

func (c *ClusterClient) DbSize() *IntCmd

func (*ClusterClient) DebugObject Uses

func (c *ClusterClient) DebugObject(key string) *StringCmd

func (*ClusterClient) Decr Uses

func (c *ClusterClient) Decr(key string) *IntCmd

func (*ClusterClient) DecrBy Uses

func (c *ClusterClient) DecrBy(key string, decrement int64) *IntCmd

func (*ClusterClient) Del Uses

func (c *ClusterClient) Del(keys ...string) *IntCmd

func (*ClusterClient) Dump Uses

func (c *ClusterClient) Dump(key string) *StringCmd

func (*ClusterClient) Echo Uses

func (c *ClusterClient) Echo(message string) *StringCmd

func (*ClusterClient) Eval Uses

func (c *ClusterClient) Eval(script string, keys []string, args []string) *Cmd

func (*ClusterClient) EvalSha Uses

func (c *ClusterClient) EvalSha(sha1 string, keys []string, args []string) *Cmd

func (*ClusterClient) Exists Uses

func (c *ClusterClient) Exists(key string) *BoolCmd

func (*ClusterClient) Expire Uses

func (c *ClusterClient) Expire(key string, expiration time.Duration) *BoolCmd

func (*ClusterClient) ExpireAt Uses

func (c *ClusterClient) ExpireAt(key string, tm time.Time) *BoolCmd

func (*ClusterClient) FlushAll Uses

func (c *ClusterClient) FlushAll() *StatusCmd

func (*ClusterClient) FlushDb Uses

func (c *ClusterClient) FlushDb() *StatusCmd

func (*ClusterClient) GeoAdd Uses

func (c *ClusterClient) GeoAdd(key string, geoLocation ...*GeoLocation) *IntCmd

func (*ClusterClient) GeoDist Uses

func (c *ClusterClient) GeoDist(key string, member1, member2, unit string) *FloatCmd

func (*ClusterClient) GeoHash Uses

func (c *ClusterClient) GeoHash(key string, members ...string) *StringSliceCmd

func (*ClusterClient) GeoRadius Uses

func (c *ClusterClient) GeoRadius(key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd

func (*ClusterClient) GeoRadiusByMember Uses

func (c *ClusterClient) GeoRadiusByMember(key, member string, query *GeoRadiusQuery) *GeoLocationCmd

func (*ClusterClient) Get Uses

func (c *ClusterClient) Get(key string) *StringCmd

func (*ClusterClient) GetBit Uses

func (c *ClusterClient) GetBit(key string, offset int64) *IntCmd

func (*ClusterClient) GetRange Uses

func (c *ClusterClient) GetRange(key string, start, end int64) *StringCmd

func (*ClusterClient) GetSet Uses

func (c *ClusterClient) GetSet(key string, value interface{}) *StringCmd

func (*ClusterClient) HDel Uses

func (c *ClusterClient) HDel(key string, fields ...string) *IntCmd

func (*ClusterClient) HExists Uses

func (c *ClusterClient) HExists(key, field string) *BoolCmd

func (*ClusterClient) HGet Uses

func (c *ClusterClient) HGet(key, field string) *StringCmd

func (*ClusterClient) HGetAll Uses

func (c *ClusterClient) HGetAll(key string) *StringSliceCmd

func (*ClusterClient) HGetAllMap Uses

func (c *ClusterClient) HGetAllMap(key string) *StringStringMapCmd

func (*ClusterClient) HIncrBy Uses

func (c *ClusterClient) HIncrBy(key, field string, incr int64) *IntCmd

func (*ClusterClient) HIncrByFloat Uses

func (c *ClusterClient) HIncrByFloat(key, field string, incr float64) *FloatCmd

func (*ClusterClient) HKeys Uses

func (c *ClusterClient) HKeys(key string) *StringSliceCmd

func (*ClusterClient) HLen Uses

func (c *ClusterClient) HLen(key string) *IntCmd

func (*ClusterClient) HMGet Uses

func (c *ClusterClient) HMGet(key string, fields ...string) *SliceCmd

func (*ClusterClient) HMSet Uses

func (c *ClusterClient) HMSet(key, field, value string, pairs ...string) *StatusCmd

func (*ClusterClient) HMSetMap Uses

func (c *ClusterClient) HMSetMap(key string, fields map[string]string) *StatusCmd

func (*ClusterClient) HScan Uses

func (c *ClusterClient) HScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*ClusterClient) HSet Uses

func (c *ClusterClient) HSet(key, field, value string) *BoolCmd

func (*ClusterClient) HSetNX Uses

func (c *ClusterClient) HSetNX(key, field, value string) *BoolCmd

func (*ClusterClient) HVals Uses

func (c *ClusterClient) HVals(key string) *StringSliceCmd

func (*ClusterClient) Incr Uses

func (c *ClusterClient) Incr(key string) *IntCmd

func (*ClusterClient) IncrBy Uses

func (c *ClusterClient) IncrBy(key string, value int64) *IntCmd

func (*ClusterClient) IncrByFloat Uses

func (c *ClusterClient) IncrByFloat(key string, value float64) *FloatCmd

func (*ClusterClient) Info Uses

func (c *ClusterClient) Info(section ...string) *StringCmd

func (*ClusterClient) Keys Uses

func (c *ClusterClient) Keys(pattern string) *StringSliceCmd

func (*ClusterClient) LIndex Uses

func (c *ClusterClient) LIndex(key string, index int64) *StringCmd

func (*ClusterClient) LInsert Uses

func (c *ClusterClient) LInsert(key, op, pivot, value string) *IntCmd

func (*ClusterClient) LLen Uses

func (c *ClusterClient) LLen(key string) *IntCmd

func (*ClusterClient) LPop Uses

func (c *ClusterClient) LPop(key string) *StringCmd

func (*ClusterClient) LPush Uses

func (c *ClusterClient) LPush(key string, values ...string) *IntCmd

func (*ClusterClient) LPushX Uses

func (c *ClusterClient) LPushX(key, value interface{}) *IntCmd

func (*ClusterClient) LRange Uses

func (c *ClusterClient) LRange(key string, start, stop int64) *StringSliceCmd

func (*ClusterClient) LRem Uses

func (c *ClusterClient) LRem(key string, count int64, value interface{}) *IntCmd

func (*ClusterClient) LSet Uses

func (c *ClusterClient) LSet(key string, index int64, value interface{}) *StatusCmd

func (*ClusterClient) LTrim Uses

func (c *ClusterClient) LTrim(key string, start, stop int64) *StatusCmd

func (*ClusterClient) LastSave Uses

func (c *ClusterClient) LastSave() *IntCmd

func (*ClusterClient) MGet Uses

func (c *ClusterClient) MGet(keys ...string) *SliceCmd

func (*ClusterClient) MSet Uses

func (c *ClusterClient) MSet(pairs ...string) *StatusCmd

func (*ClusterClient) MSetNX Uses

func (c *ClusterClient) MSetNX(pairs ...string) *BoolCmd

func (*ClusterClient) Migrate Uses

func (c *ClusterClient) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd

func (*ClusterClient) Move Uses

func (c *ClusterClient) Move(key string, db int64) *BoolCmd

func (*ClusterClient) ObjectEncoding Uses

func (c *ClusterClient) ObjectEncoding(keys ...string) *StringCmd

func (*ClusterClient) ObjectIdleTime Uses

func (c *ClusterClient) ObjectIdleTime(keys ...string) *DurationCmd

func (*ClusterClient) ObjectRefCount Uses

func (c *ClusterClient) ObjectRefCount(keys ...string) *IntCmd

func (*ClusterClient) PExpire Uses

func (c *ClusterClient) PExpire(key string, expiration time.Duration) *BoolCmd

func (*ClusterClient) PExpireAt Uses

func (c *ClusterClient) PExpireAt(key string, tm time.Time) *BoolCmd

func (*ClusterClient) PFAdd Uses

func (c *ClusterClient) PFAdd(key string, fields ...string) *IntCmd

func (*ClusterClient) PFCount Uses

func (c *ClusterClient) PFCount(keys ...string) *IntCmd

func (*ClusterClient) PFMerge Uses

func (c *ClusterClient) PFMerge(dest string, keys ...string) *StatusCmd

func (*ClusterClient) PTTL Uses

func (c *ClusterClient) PTTL(key string) *DurationCmd

func (*ClusterClient) Persist Uses

func (c *ClusterClient) Persist(key string) *BoolCmd

func (*ClusterClient) Ping Uses

func (c *ClusterClient) Ping() *StatusCmd

func (*ClusterClient) Pipeline Uses

func (c *ClusterClient) Pipeline() *ClusterPipeline

Pipeline creates a new pipeline which is able to execute commands against multiple shards. It's NOT safe for concurrent use by multiple goroutines.

func (*ClusterClient) Pipelined Uses

func (c *ClusterClient) Pipelined(fn func(*ClusterPipeline) error) ([]Cmder, error)

func (*ClusterClient) PoolStats Uses

func (c *ClusterClient) PoolStats() *PoolStats

PoolStats returns accumulated connection pool stats.

func (*ClusterClient) Process Uses

func (c *ClusterClient) Process(cmd Cmder)

func (*ClusterClient) PubSubChannels Uses

func (c *ClusterClient) PubSubChannels(pattern string) *StringSliceCmd

func (*ClusterClient) PubSubNumPat Uses

func (c *ClusterClient) PubSubNumPat() *IntCmd

func (*ClusterClient) PubSubNumSub Uses

func (c *ClusterClient) PubSubNumSub(channels ...string) *StringIntMapCmd

func (*ClusterClient) Quit Uses

func (c *ClusterClient) Quit() *StatusCmd

func (*ClusterClient) RPop Uses

func (c *ClusterClient) RPop(key string) *StringCmd

func (*ClusterClient) RPopLPush Uses

func (c *ClusterClient) RPopLPush(source, destination string) *StringCmd

func (*ClusterClient) RPush Uses

func (c *ClusterClient) RPush(key string, values ...string) *IntCmd

func (*ClusterClient) RPushX Uses

func (c *ClusterClient) RPushX(key string, value interface{}) *IntCmd

func (*ClusterClient) RandomKey Uses

func (c *ClusterClient) RandomKey() *StringCmd

func (*ClusterClient) ReadWrite Uses

func (c *ClusterClient) ReadWrite() *StatusCmd

func (*ClusterClient) Readonly Uses

func (c *ClusterClient) Readonly() *StatusCmd

func (*ClusterClient) Rename Uses

func (c *ClusterClient) Rename(key, newkey string) *StatusCmd

func (*ClusterClient) RenameNX Uses

func (c *ClusterClient) RenameNX(key, newkey string) *BoolCmd

func (*ClusterClient) Restore Uses

func (c *ClusterClient) Restore(key string, ttl time.Duration, value string) *StatusCmd

func (*ClusterClient) RestoreReplace Uses

func (c *ClusterClient) RestoreReplace(key string, ttl time.Duration, value string) *StatusCmd

func (*ClusterClient) SAdd Uses

func (c *ClusterClient) SAdd(key string, members ...string) *IntCmd

func (*ClusterClient) SCard Uses

func (c *ClusterClient) SCard(key string) *IntCmd

func (*ClusterClient) SDiff Uses

func (c *ClusterClient) SDiff(keys ...string) *StringSliceCmd

func (*ClusterClient) SDiffStore Uses

func (c *ClusterClient) SDiffStore(destination string, keys ...string) *IntCmd

func (*ClusterClient) SInter Uses

func (c *ClusterClient) SInter(keys ...string) *StringSliceCmd

func (*ClusterClient) SInterStore Uses

func (c *ClusterClient) SInterStore(destination string, keys ...string) *IntCmd

func (*ClusterClient) SIsMember Uses

func (c *ClusterClient) SIsMember(key string, member interface{}) *BoolCmd

func (*ClusterClient) SMembers Uses

func (c *ClusterClient) SMembers(key string) *StringSliceCmd

func (*ClusterClient) SMove Uses

func (c *ClusterClient) SMove(source, destination string, member interface{}) *BoolCmd

func (*ClusterClient) SPop Uses

func (c *ClusterClient) SPop(key string) *StringCmd

Redis `SPOP key` command.

func (*ClusterClient) SPopN Uses

func (c *ClusterClient) SPopN(key string, count int64) *StringSliceCmd

Redis `SPOP key count` command.

func (*ClusterClient) SRandMember Uses

func (c *ClusterClient) SRandMember(key string) *StringCmd

Redis `SRANDMEMBER key` command.

func (*ClusterClient) SRandMemberN Uses

func (c *ClusterClient) SRandMemberN(key string, count int64) *StringSliceCmd

Redis `SRANDMEMBER key count` command.

func (*ClusterClient) SRem Uses

func (c *ClusterClient) SRem(key string, members ...string) *IntCmd

func (*ClusterClient) SScan Uses

func (c *ClusterClient) SScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*ClusterClient) SUnion Uses

func (c *ClusterClient) SUnion(keys ...string) *StringSliceCmd

func (*ClusterClient) SUnionStore Uses

func (c *ClusterClient) SUnionStore(destination string, keys ...string) *IntCmd

func (*ClusterClient) Save Uses

func (c *ClusterClient) Save() *StatusCmd

func (*ClusterClient) Scan Uses

func (c *ClusterClient) Scan(cursor int64, match string, count int64) *ScanCmd

func (*ClusterClient) ScriptExists Uses

func (c *ClusterClient) ScriptExists(scripts ...string) *BoolSliceCmd

func (*ClusterClient) ScriptFlush Uses

func (c *ClusterClient) ScriptFlush() *StatusCmd

func (*ClusterClient) ScriptKill Uses

func (c *ClusterClient) ScriptKill() *StatusCmd

func (*ClusterClient) ScriptLoad Uses

func (c *ClusterClient) ScriptLoad(script string) *StringCmd

func (*ClusterClient) Select Uses

func (c *ClusterClient) Select(index int64) *StatusCmd

func (*ClusterClient) Set Uses

func (c *ClusterClient) Set(key string, value interface{}, expiration time.Duration) *StatusCmd

Redis `SET key value [expiration]` command.

Zero expiration means the key has no expiration time.

func (*ClusterClient) SetBit Uses

func (c *ClusterClient) SetBit(key string, offset int64, value int) *IntCmd

func (*ClusterClient) SetNX Uses

func (c *ClusterClient) SetNX(key string, value interface{}, expiration time.Duration) *BoolCmd

Redis `SET key value [expiration] NX` command.

Zero expiration means the key has no expiration time.

func (*ClusterClient) SetRange Uses

func (c *ClusterClient) SetRange(key string, offset int64, value string) *IntCmd

func (*ClusterClient) SetXX Uses

func (c *ClusterClient) SetXX(key string, value interface{}, expiration time.Duration) *BoolCmd

Redis `SET key value [expiration] XX` command.

Zero expiration means the key has no expiration time.

func (*ClusterClient) Shutdown Uses

func (c *ClusterClient) Shutdown() *StatusCmd

func (*ClusterClient) ShutdownNoSave Uses

func (c *ClusterClient) ShutdownNoSave() *StatusCmd

func (*ClusterClient) ShutdownSave Uses

func (c *ClusterClient) ShutdownSave() *StatusCmd

func (*ClusterClient) SlaveOf Uses

func (c *ClusterClient) SlaveOf(host, port string) *StatusCmd

func (*ClusterClient) SlowLog Uses

func (c *ClusterClient) SlowLog()

func (*ClusterClient) Sort Uses

func (c *ClusterClient) Sort(key string, sort Sort) *StringSliceCmd

func (*ClusterClient) SortInterfaces Uses

func (c *ClusterClient) SortInterfaces(key string, sort Sort) *SliceCmd

func (*ClusterClient) StrLen Uses

func (c *ClusterClient) StrLen(key string) *IntCmd

func (*ClusterClient) Sync Uses

func (c *ClusterClient) Sync()

func (*ClusterClient) TTL Uses

func (c *ClusterClient) TTL(key string) *DurationCmd

func (*ClusterClient) Time Uses

func (c *ClusterClient) Time() *StringSliceCmd

func (*ClusterClient) Type Uses

func (c *ClusterClient) Type(key string) *StatusCmd

func (*ClusterClient) Watch Uses

func (c *ClusterClient) Watch(keys ...string) (*Multi, error)

Watch creates new transaction and marks the keys to be watched for conditional execution of a transaction.

func (*ClusterClient) ZAdd Uses

func (c *ClusterClient) ZAdd(key string, members ...Z) *IntCmd

Redis `ZADD key score member [score member ...]` command.

func (*ClusterClient) ZAddCh Uses

func (c *ClusterClient) ZAddCh(key string, members ...Z) *IntCmd

Redis `ZADD key CH score member [score member ...]` command.

func (*ClusterClient) ZAddNX Uses

func (c *ClusterClient) ZAddNX(key string, members ...Z) *IntCmd

Redis `ZADD key NX score member [score member ...]` command.

func (*ClusterClient) ZAddNXCh Uses

func (c *ClusterClient) ZAddNXCh(key string, members ...Z) *IntCmd

Redis `ZADD key NX CH score member [score member ...]` command.

func (*ClusterClient) ZAddXX Uses

func (c *ClusterClient) ZAddXX(key string, members ...Z) *IntCmd

Redis `ZADD key XX score member [score member ...]` command.

func (*ClusterClient) ZAddXXCh Uses

func (c *ClusterClient) ZAddXXCh(key string, members ...Z) *IntCmd

Redis `ZADD key XX CH score member [score member ...]` command.

func (*ClusterClient) ZCard Uses

func (c *ClusterClient) ZCard(key string) *IntCmd

func (*ClusterClient) ZCount Uses

func (c *ClusterClient) ZCount(key, min, max string) *IntCmd

func (*ClusterClient) ZIncr Uses

func (c *ClusterClient) ZIncr(key string, member Z) *FloatCmd

Redis `ZADD key INCR score member` command.

func (*ClusterClient) ZIncrBy Uses

func (c *ClusterClient) ZIncrBy(key string, increment float64, member string) *FloatCmd

func (*ClusterClient) ZIncrNX Uses

func (c *ClusterClient) ZIncrNX(key string, member Z) *FloatCmd

Redis `ZADD key NX INCR score member` command.

func (*ClusterClient) ZIncrXX Uses

func (c *ClusterClient) ZIncrXX(key string, member Z) *FloatCmd

Redis `ZADD key XX INCR score member` command.

func (*ClusterClient) ZInterStore Uses

func (c *ClusterClient) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd

func (*ClusterClient) ZRange Uses

func (c *ClusterClient) ZRange(key string, start, stop int64) *StringSliceCmd

func (*ClusterClient) ZRangeByLex Uses

func (c *ClusterClient) ZRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd

func (*ClusterClient) ZRangeByScore Uses

func (c *ClusterClient) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd

func (*ClusterClient) ZRangeByScoreWithScores Uses

func (c *ClusterClient) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd

func (*ClusterClient) ZRangeWithScores Uses

func (c *ClusterClient) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd

func (*ClusterClient) ZRank Uses

func (c *ClusterClient) ZRank(key, member string) *IntCmd

func (*ClusterClient) ZRem Uses

func (c *ClusterClient) ZRem(key string, members ...string) *IntCmd

func (*ClusterClient) ZRemRangeByRank Uses

func (c *ClusterClient) ZRemRangeByRank(key string, start, stop int64) *IntCmd

func (*ClusterClient) ZRemRangeByScore Uses

func (c *ClusterClient) ZRemRangeByScore(key, min, max string) *IntCmd

func (*ClusterClient) ZRevRange Uses

func (c *ClusterClient) ZRevRange(key string, start, stop int64) *StringSliceCmd

func (*ClusterClient) ZRevRangeByLex Uses

func (c *ClusterClient) ZRevRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd

func (*ClusterClient) ZRevRangeByScore Uses

func (c *ClusterClient) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd

func (*ClusterClient) ZRevRangeByScoreWithScores Uses

func (c *ClusterClient) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd

func (*ClusterClient) ZRevRangeWithScores Uses

func (c *ClusterClient) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd

func (*ClusterClient) ZRevRank Uses

func (c *ClusterClient) ZRevRank(key, member string) *IntCmd

func (*ClusterClient) ZScan Uses

func (c *ClusterClient) ZScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*ClusterClient) ZScore Uses

func (c *ClusterClient) ZScore(key, member string) *FloatCmd

func (*ClusterClient) ZUnionStore Uses

func (c *ClusterClient) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd

type ClusterOptions Uses

type ClusterOptions struct {
    // A seed list of host:port addresses of cluster nodes.
    Addrs []string

    // The maximum number of retries before giving up. Command is retried
    // on network errors and MOVED/ASK redirects.
    // Default is 16.
    MaxRedirects int

    Password string

    DialTimeout  time.Duration
    ReadTimeout  time.Duration
    WriteTimeout time.Duration

    // PoolSize applies per cluster node and not for the whole cluster.
    PoolSize           int
    PoolTimeout        time.Duration
    IdleTimeout        time.Duration
    IdleCheckFrequency time.Duration
}

ClusterOptions are used to configure a cluster client and should be passed to NewClusterClient.

type ClusterPipeline Uses

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

ClusterPipeline is not thread-safe.

func (*ClusterPipeline) Append Uses

func (c *ClusterPipeline) Append(key, value string) *IntCmd

func (*ClusterPipeline) Auth Uses

func (c *ClusterPipeline) Auth(password string) *StatusCmd

func (*ClusterPipeline) BLPop Uses

func (c *ClusterPipeline) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd

func (*ClusterPipeline) BRPop Uses

func (c *ClusterPipeline) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd

func (*ClusterPipeline) BRPopLPush Uses

func (c *ClusterPipeline) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd

func (*ClusterPipeline) BgRewriteAOF Uses

func (c *ClusterPipeline) BgRewriteAOF() *StatusCmd

func (*ClusterPipeline) BgSave Uses

func (c *ClusterPipeline) BgSave() *StatusCmd

func (*ClusterPipeline) BitCount Uses

func (c *ClusterPipeline) BitCount(key string, bitCount *BitCount) *IntCmd

func (*ClusterPipeline) BitOpAnd Uses

func (c *ClusterPipeline) BitOpAnd(destKey string, keys ...string) *IntCmd

func (*ClusterPipeline) BitOpNot Uses

func (c *ClusterPipeline) BitOpNot(destKey string, key string) *IntCmd

func (*ClusterPipeline) BitOpOr Uses

func (c *ClusterPipeline) BitOpOr(destKey string, keys ...string) *IntCmd

func (*ClusterPipeline) BitOpXor Uses

func (c *ClusterPipeline) BitOpXor(destKey string, keys ...string) *IntCmd

func (*ClusterPipeline) BitPos Uses

func (c *ClusterPipeline) BitPos(key string, bit int64, pos ...int64) *IntCmd

func (*ClusterPipeline) ClientKill Uses

func (c *ClusterPipeline) ClientKill(ipPort string) *StatusCmd

func (*ClusterPipeline) ClientList Uses

func (c *ClusterPipeline) ClientList() *StringCmd

func (*ClusterPipeline) ClientPause Uses

func (c *ClusterPipeline) ClientPause(dur time.Duration) *BoolCmd

func (*ClusterPipeline) ClientSetName Uses

func (c *ClusterPipeline) ClientSetName(name string) *BoolCmd

ClientSetName assigns a name to the one of many connections in the pool.

func (*ClusterPipeline) Close Uses

func (pipe *ClusterPipeline) Close() error

Close closes the pipeline, releasing any open resources.

func (*ClusterPipeline) ClusterAddSlots Uses

func (c *ClusterPipeline) ClusterAddSlots(slots ...int) *StatusCmd

func (*ClusterPipeline) ClusterAddSlotsRange Uses

func (c *ClusterPipeline) ClusterAddSlotsRange(min, max int) *StatusCmd

func (*ClusterPipeline) ClusterCountFailureReports Uses

func (c *ClusterPipeline) ClusterCountFailureReports(nodeID string) *IntCmd

func (*ClusterPipeline) ClusterCountKeysInSlot Uses

func (c *ClusterPipeline) ClusterCountKeysInSlot(slot int) *IntCmd

func (*ClusterPipeline) ClusterDelSlots Uses

func (c *ClusterPipeline) ClusterDelSlots(slots ...int) *StatusCmd

func (*ClusterPipeline) ClusterDelSlotsRange Uses

func (c *ClusterPipeline) ClusterDelSlotsRange(min, max int) *StatusCmd

func (*ClusterPipeline) ClusterFailover Uses

func (c *ClusterPipeline) ClusterFailover() *StatusCmd

func (*ClusterPipeline) ClusterForget Uses

func (c *ClusterPipeline) ClusterForget(nodeID string) *StatusCmd

func (*ClusterPipeline) ClusterInfo Uses

func (c *ClusterPipeline) ClusterInfo() *StringCmd

func (*ClusterPipeline) ClusterKeySlot Uses

func (c *ClusterPipeline) ClusterKeySlot(key string) *IntCmd

func (*ClusterPipeline) ClusterMeet Uses

func (c *ClusterPipeline) ClusterMeet(host, port string) *StatusCmd

func (*ClusterPipeline) ClusterNodes Uses

func (c *ClusterPipeline) ClusterNodes() *StringCmd

func (*ClusterPipeline) ClusterReplicate Uses

func (c *ClusterPipeline) ClusterReplicate(nodeID string) *StatusCmd

func (*ClusterPipeline) ClusterResetHard Uses

func (c *ClusterPipeline) ClusterResetHard() *StatusCmd

func (*ClusterPipeline) ClusterResetSoft Uses

func (c *ClusterPipeline) ClusterResetSoft() *StatusCmd

func (*ClusterPipeline) ClusterSaveConfig Uses

func (c *ClusterPipeline) ClusterSaveConfig() *StatusCmd

func (*ClusterPipeline) ClusterSlaves Uses

func (c *ClusterPipeline) ClusterSlaves(nodeID string) *StringSliceCmd

func (*ClusterPipeline) ClusterSlots Uses

func (c *ClusterPipeline) ClusterSlots() *ClusterSlotCmd

func (*ClusterPipeline) ConfigGet Uses

func (c *ClusterPipeline) ConfigGet(parameter string) *SliceCmd

func (*ClusterPipeline) ConfigResetStat Uses

func (c *ClusterPipeline) ConfigResetStat() *StatusCmd

func (*ClusterPipeline) ConfigSet Uses

func (c *ClusterPipeline) ConfigSet(parameter, value string) *StatusCmd

func (*ClusterPipeline) DbSize Uses

func (c *ClusterPipeline) DbSize() *IntCmd

func (*ClusterPipeline) DebugObject Uses

func (c *ClusterPipeline) DebugObject(key string) *StringCmd

func (*ClusterPipeline) Decr Uses

func (c *ClusterPipeline) Decr(key string) *IntCmd

func (*ClusterPipeline) DecrBy Uses

func (c *ClusterPipeline) DecrBy(key string, decrement int64) *IntCmd

func (*ClusterPipeline) Del Uses

func (c *ClusterPipeline) Del(keys ...string) *IntCmd

func (*ClusterPipeline) Discard Uses

func (pipe *ClusterPipeline) Discard() error

Discard resets the pipeline and discards queued commands.

func (*ClusterPipeline) Dump Uses

func (c *ClusterPipeline) Dump(key string) *StringCmd

func (*ClusterPipeline) Echo Uses

func (c *ClusterPipeline) Echo(message string) *StringCmd

func (*ClusterPipeline) Eval Uses

func (c *ClusterPipeline) Eval(script string, keys []string, args []string) *Cmd

func (*ClusterPipeline) EvalSha Uses

func (c *ClusterPipeline) EvalSha(sha1 string, keys []string, args []string) *Cmd

func (*ClusterPipeline) Exec Uses

func (pipe *ClusterPipeline) Exec() (cmds []Cmder, retErr error)

func (*ClusterPipeline) Exists Uses

func (c *ClusterPipeline) Exists(key string) *BoolCmd

func (*ClusterPipeline) Expire Uses

func (c *ClusterPipeline) Expire(key string, expiration time.Duration) *BoolCmd

func (*ClusterPipeline) ExpireAt Uses

func (c *ClusterPipeline) ExpireAt(key string, tm time.Time) *BoolCmd

func (*ClusterPipeline) FlushAll Uses

func (c *ClusterPipeline) FlushAll() *StatusCmd

func (*ClusterPipeline) FlushDb Uses

func (c *ClusterPipeline) FlushDb() *StatusCmd

func (*ClusterPipeline) GeoAdd Uses

func (c *ClusterPipeline) GeoAdd(key string, geoLocation ...*GeoLocation) *IntCmd

func (*ClusterPipeline) GeoDist Uses

func (c *ClusterPipeline) GeoDist(key string, member1, member2, unit string) *FloatCmd

func (*ClusterPipeline) GeoHash Uses

func (c *ClusterPipeline) GeoHash(key string, members ...string) *StringSliceCmd

func (*ClusterPipeline) GeoRadius Uses

func (c *ClusterPipeline) GeoRadius(key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd

func (*ClusterPipeline) GeoRadiusByMember Uses

func (c *ClusterPipeline) GeoRadiusByMember(key, member string, query *GeoRadiusQuery) *GeoLocationCmd

func (*ClusterPipeline) Get Uses

func (c *ClusterPipeline) Get(key string) *StringCmd

func (*ClusterPipeline) GetBit Uses

func (c *ClusterPipeline) GetBit(key string, offset int64) *IntCmd

func (*ClusterPipeline) GetRange Uses

func (c *ClusterPipeline) GetRange(key string, start, end int64) *StringCmd

func (*ClusterPipeline) GetSet Uses

func (c *ClusterPipeline) GetSet(key string, value interface{}) *StringCmd

func (*ClusterPipeline) HDel Uses

func (c *ClusterPipeline) HDel(key string, fields ...string) *IntCmd

func (*ClusterPipeline) HExists Uses

func (c *ClusterPipeline) HExists(key, field string) *BoolCmd

func (*ClusterPipeline) HGet Uses

func (c *ClusterPipeline) HGet(key, field string) *StringCmd

func (*ClusterPipeline) HGetAll Uses

func (c *ClusterPipeline) HGetAll(key string) *StringSliceCmd

func (*ClusterPipeline) HGetAllMap Uses

func (c *ClusterPipeline) HGetAllMap(key string) *StringStringMapCmd

func (*ClusterPipeline) HIncrBy Uses

func (c *ClusterPipeline) HIncrBy(key, field string, incr int64) *IntCmd

func (*ClusterPipeline) HIncrByFloat Uses

func (c *ClusterPipeline) HIncrByFloat(key, field string, incr float64) *FloatCmd

func (*ClusterPipeline) HKeys Uses

func (c *ClusterPipeline) HKeys(key string) *StringSliceCmd

func (*ClusterPipeline) HLen Uses

func (c *ClusterPipeline) HLen(key string) *IntCmd

func (*ClusterPipeline) HMGet Uses

func (c *ClusterPipeline) HMGet(key string, fields ...string) *SliceCmd

func (*ClusterPipeline) HMSet Uses

func (c *ClusterPipeline) HMSet(key, field, value string, pairs ...string) *StatusCmd

func (*ClusterPipeline) HMSetMap Uses

func (c *ClusterPipeline) HMSetMap(key string, fields map[string]string) *StatusCmd

func (*ClusterPipeline) HScan Uses

func (c *ClusterPipeline) HScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*ClusterPipeline) HSet Uses

func (c *ClusterPipeline) HSet(key, field, value string) *BoolCmd

func (*ClusterPipeline) HSetNX Uses

func (c *ClusterPipeline) HSetNX(key, field, value string) *BoolCmd

func (*ClusterPipeline) HVals Uses

func (c *ClusterPipeline) HVals(key string) *StringSliceCmd

func (*ClusterPipeline) Incr Uses

func (c *ClusterPipeline) Incr(key string) *IntCmd

func (*ClusterPipeline) IncrBy Uses

func (c *ClusterPipeline) IncrBy(key string, value int64) *IntCmd

func (*ClusterPipeline) IncrByFloat Uses

func (c *ClusterPipeline) IncrByFloat(key string, value float64) *FloatCmd

func (*ClusterPipeline) Info Uses

func (c *ClusterPipeline) Info(section ...string) *StringCmd

func (*ClusterPipeline) Keys Uses

func (c *ClusterPipeline) Keys(pattern string) *StringSliceCmd

func (*ClusterPipeline) LIndex Uses

func (c *ClusterPipeline) LIndex(key string, index int64) *StringCmd

func (*ClusterPipeline) LInsert Uses

func (c *ClusterPipeline) LInsert(key, op, pivot, value string) *IntCmd

func (*ClusterPipeline) LLen Uses

func (c *ClusterPipeline) LLen(key string) *IntCmd

func (*ClusterPipeline) LPop Uses

func (c *ClusterPipeline) LPop(key string) *StringCmd

func (*ClusterPipeline) LPush Uses

func (c *ClusterPipeline) LPush(key string, values ...string) *IntCmd

func (*ClusterPipeline) LPushX Uses

func (c *ClusterPipeline) LPushX(key, value interface{}) *IntCmd

func (*ClusterPipeline) LRange Uses

func (c *ClusterPipeline) LRange(key string, start, stop int64) *StringSliceCmd

func (*ClusterPipeline) LRem Uses

func (c *ClusterPipeline) LRem(key string, count int64, value interface{}) *IntCmd

func (*ClusterPipeline) LSet Uses

func (c *ClusterPipeline) LSet(key string, index int64, value interface{}) *StatusCmd

func (*ClusterPipeline) LTrim Uses

func (c *ClusterPipeline) LTrim(key string, start, stop int64) *StatusCmd

func (*ClusterPipeline) LastSave Uses

func (c *ClusterPipeline) LastSave() *IntCmd

func (*ClusterPipeline) MGet Uses

func (c *ClusterPipeline) MGet(keys ...string) *SliceCmd

func (*ClusterPipeline) MSet Uses

func (c *ClusterPipeline) MSet(pairs ...string) *StatusCmd

func (*ClusterPipeline) MSetNX Uses

func (c *ClusterPipeline) MSetNX(pairs ...string) *BoolCmd

func (*ClusterPipeline) Migrate Uses

func (c *ClusterPipeline) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd

func (*ClusterPipeline) Move Uses

func (c *ClusterPipeline) Move(key string, db int64) *BoolCmd

func (*ClusterPipeline) ObjectEncoding Uses

func (c *ClusterPipeline) ObjectEncoding(keys ...string) *StringCmd

func (*ClusterPipeline) ObjectIdleTime Uses

func (c *ClusterPipeline) ObjectIdleTime(keys ...string) *DurationCmd

func (*ClusterPipeline) ObjectRefCount Uses

func (c *ClusterPipeline) ObjectRefCount(keys ...string) *IntCmd

func (*ClusterPipeline) PExpire Uses

func (c *ClusterPipeline) PExpire(key string, expiration time.Duration) *BoolCmd

func (*ClusterPipeline) PExpireAt Uses

func (c *ClusterPipeline) PExpireAt(key string, tm time.Time) *BoolCmd

func (*ClusterPipeline) PFAdd Uses

func (c *ClusterPipeline) PFAdd(key string, fields ...string) *IntCmd

func (*ClusterPipeline) PFCount Uses

func (c *ClusterPipeline) PFCount(keys ...string) *IntCmd

func (*ClusterPipeline) PFMerge Uses

func (c *ClusterPipeline) PFMerge(dest string, keys ...string) *StatusCmd

func (*ClusterPipeline) PTTL Uses

func (c *ClusterPipeline) PTTL(key string) *DurationCmd

func (*ClusterPipeline) Persist Uses

func (c *ClusterPipeline) Persist(key string) *BoolCmd

func (*ClusterPipeline) Ping Uses

func (c *ClusterPipeline) Ping() *StatusCmd

func (*ClusterPipeline) Process Uses

func (c *ClusterPipeline) Process(cmd Cmder)

func (*ClusterPipeline) PubSubChannels Uses

func (c *ClusterPipeline) PubSubChannels(pattern string) *StringSliceCmd

func (*ClusterPipeline) PubSubNumPat Uses

func (c *ClusterPipeline) PubSubNumPat() *IntCmd

func (*ClusterPipeline) PubSubNumSub Uses

func (c *ClusterPipeline) PubSubNumSub(channels ...string) *StringIntMapCmd

func (*ClusterPipeline) Quit Uses

func (c *ClusterPipeline) Quit() *StatusCmd

func (*ClusterPipeline) RPop Uses

func (c *ClusterPipeline) RPop(key string) *StringCmd

func (*ClusterPipeline) RPopLPush Uses

func (c *ClusterPipeline) RPopLPush(source, destination string) *StringCmd

func (*ClusterPipeline) RPush Uses

func (c *ClusterPipeline) RPush(key string, values ...string) *IntCmd

func (*ClusterPipeline) RPushX Uses

func (c *ClusterPipeline) RPushX(key string, value interface{}) *IntCmd

func (*ClusterPipeline) RandomKey Uses

func (c *ClusterPipeline) RandomKey() *StringCmd

func (*ClusterPipeline) ReadWrite Uses

func (c *ClusterPipeline) ReadWrite() *StatusCmd

func (*ClusterPipeline) Readonly Uses

func (c *ClusterPipeline) Readonly() *StatusCmd

func (*ClusterPipeline) Rename Uses

func (c *ClusterPipeline) Rename(key, newkey string) *StatusCmd

func (*ClusterPipeline) RenameNX Uses

func (c *ClusterPipeline) RenameNX(key, newkey string) *BoolCmd

func (*ClusterPipeline) Restore Uses

func (c *ClusterPipeline) Restore(key string, ttl time.Duration, value string) *StatusCmd

func (*ClusterPipeline) RestoreReplace Uses

func (c *ClusterPipeline) RestoreReplace(key string, ttl time.Duration, value string) *StatusCmd

func (*ClusterPipeline) SAdd Uses

func (c *ClusterPipeline) SAdd(key string, members ...string) *IntCmd

func (*ClusterPipeline) SCard Uses

func (c *ClusterPipeline) SCard(key string) *IntCmd

func (*ClusterPipeline) SDiff Uses

func (c *ClusterPipeline) SDiff(keys ...string) *StringSliceCmd

func (*ClusterPipeline) SDiffStore Uses

func (c *ClusterPipeline) SDiffStore(destination string, keys ...string) *IntCmd

func (*ClusterPipeline) SInter Uses

func (c *ClusterPipeline) SInter(keys ...string) *StringSliceCmd

func (*ClusterPipeline) SInterStore Uses

func (c *ClusterPipeline) SInterStore(destination string, keys ...string) *IntCmd

func (*ClusterPipeline) SIsMember Uses

func (c *ClusterPipeline) SIsMember(key string, member interface{}) *BoolCmd

func (*ClusterPipeline) SMembers Uses

func (c *ClusterPipeline) SMembers(key string) *StringSliceCmd

func (*ClusterPipeline) SMove Uses

func (c *ClusterPipeline) SMove(source, destination string, member interface{}) *BoolCmd

func (*ClusterPipeline) SPop Uses

func (c *ClusterPipeline) SPop(key string) *StringCmd

Redis `SPOP key` command.

func (*ClusterPipeline) SPopN Uses

func (c *ClusterPipeline) SPopN(key string, count int64) *StringSliceCmd

Redis `SPOP key count` command.

func (*ClusterPipeline) SRandMember Uses

func (c *ClusterPipeline) SRandMember(key string) *StringCmd

Redis `SRANDMEMBER key` command.

func (*ClusterPipeline) SRandMemberN Uses

func (c *ClusterPipeline) SRandMemberN(key string, count int64) *StringSliceCmd

Redis `SRANDMEMBER key count` command.

func (*ClusterPipeline) SRem Uses

func (c *ClusterPipeline) SRem(key string, members ...string) *IntCmd

func (*ClusterPipeline) SScan Uses

func (c *ClusterPipeline) SScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*ClusterPipeline) SUnion Uses

func (c *ClusterPipeline) SUnion(keys ...string) *StringSliceCmd

func (*ClusterPipeline) SUnionStore Uses

func (c *ClusterPipeline) SUnionStore(destination string, keys ...string) *IntCmd

func (*ClusterPipeline) Save Uses

func (c *ClusterPipeline) Save() *StatusCmd

func (*ClusterPipeline) Scan Uses

func (c *ClusterPipeline) Scan(cursor int64, match string, count int64) *ScanCmd

func (*ClusterPipeline) ScriptExists Uses

func (c *ClusterPipeline) ScriptExists(scripts ...string) *BoolSliceCmd

func (*ClusterPipeline) ScriptFlush Uses

func (c *ClusterPipeline) ScriptFlush() *StatusCmd

func (*ClusterPipeline) ScriptKill Uses

func (c *ClusterPipeline) ScriptKill() *StatusCmd

func (*ClusterPipeline) ScriptLoad Uses

func (c *ClusterPipeline) ScriptLoad(script string) *StringCmd

func (*ClusterPipeline) Select Uses

func (c *ClusterPipeline) Select(index int64) *StatusCmd

func (*ClusterPipeline) Set Uses

func (c *ClusterPipeline) Set(key string, value interface{}, expiration time.Duration) *StatusCmd

Redis `SET key value [expiration]` command.

Zero expiration means the key has no expiration time.

func (*ClusterPipeline) SetBit Uses

func (c *ClusterPipeline) SetBit(key string, offset int64, value int) *IntCmd

func (*ClusterPipeline) SetNX Uses

func (c *ClusterPipeline) SetNX(key string, value interface{}, expiration time.Duration) *BoolCmd

Redis `SET key value [expiration] NX` command.

Zero expiration means the key has no expiration time.

func (*ClusterPipeline) SetRange Uses

func (c *ClusterPipeline) SetRange(key string, offset int64, value string) *IntCmd

func (*ClusterPipeline) SetXX Uses

func (c *ClusterPipeline) SetXX(key string, value interface{}, expiration time.Duration) *BoolCmd

Redis `SET key value [expiration] XX` command.

Zero expiration means the key has no expiration time.

func (*ClusterPipeline) Shutdown Uses

func (c *ClusterPipeline) Shutdown() *StatusCmd

func (*ClusterPipeline) ShutdownNoSave Uses

func (c *ClusterPipeline) ShutdownNoSave() *StatusCmd

func (*ClusterPipeline) ShutdownSave Uses

func (c *ClusterPipeline) ShutdownSave() *StatusCmd

func (*ClusterPipeline) SlaveOf Uses

func (c *ClusterPipeline) SlaveOf(host, port string) *StatusCmd

func (*ClusterPipeline) SlowLog Uses

func (c *ClusterPipeline) SlowLog()

func (*ClusterPipeline) Sort Uses

func (c *ClusterPipeline) Sort(key string, sort Sort) *StringSliceCmd

func (*ClusterPipeline) SortInterfaces Uses

func (c *ClusterPipeline) SortInterfaces(key string, sort Sort) *SliceCmd

func (*ClusterPipeline) StrLen Uses

func (c *ClusterPipeline) StrLen(key string) *IntCmd

func (*ClusterPipeline) Sync Uses

func (c *ClusterPipeline) Sync()

func (*ClusterPipeline) TTL Uses

func (c *ClusterPipeline) TTL(key string) *DurationCmd

func (*ClusterPipeline) Time Uses

func (c *ClusterPipeline) Time() *StringSliceCmd

func (*ClusterPipeline) Type Uses

func (c *ClusterPipeline) Type(key string) *StatusCmd

func (*ClusterPipeline) ZAdd Uses

func (c *ClusterPipeline) ZAdd(key string, members ...Z) *IntCmd

Redis `ZADD key score member [score member ...]` command.

func (*ClusterPipeline) ZAddCh Uses

func (c *ClusterPipeline) ZAddCh(key string, members ...Z) *IntCmd

Redis `ZADD key CH score member [score member ...]` command.

func (*ClusterPipeline) ZAddNX Uses

func (c *ClusterPipeline) ZAddNX(key string, members ...Z) *IntCmd

Redis `ZADD key NX score member [score member ...]` command.

func (*ClusterPipeline) ZAddNXCh Uses

func (c *ClusterPipeline) ZAddNXCh(key string, members ...Z) *IntCmd

Redis `ZADD key NX CH score member [score member ...]` command.

func (*ClusterPipeline) ZAddXX Uses

func (c *ClusterPipeline) ZAddXX(key string, members ...Z) *IntCmd

Redis `ZADD key XX score member [score member ...]` command.

func (*ClusterPipeline) ZAddXXCh Uses

func (c *ClusterPipeline) ZAddXXCh(key string, members ...Z) *IntCmd

Redis `ZADD key XX CH score member [score member ...]` command.

func (*ClusterPipeline) ZCard Uses

func (c *ClusterPipeline) ZCard(key string) *IntCmd

func (*ClusterPipeline) ZCount Uses

func (c *ClusterPipeline) ZCount(key, min, max string) *IntCmd

func (*ClusterPipeline) ZIncr Uses

func (c *ClusterPipeline) ZIncr(key string, member Z) *FloatCmd

Redis `ZADD key INCR score member` command.

func (*ClusterPipeline) ZIncrBy Uses

func (c *ClusterPipeline) ZIncrBy(key string, increment float64, member string) *FloatCmd

func (*ClusterPipeline) ZIncrNX Uses

func (c *ClusterPipeline) ZIncrNX(key string, member Z) *FloatCmd

Redis `ZADD key NX INCR score member` command.

func (*ClusterPipeline) ZIncrXX Uses

func (c *ClusterPipeline) ZIncrXX(key string, member Z) *FloatCmd

Redis `ZADD key XX INCR score member` command.

func (*ClusterPipeline) ZInterStore Uses

func (c *ClusterPipeline) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd

func (*ClusterPipeline) ZRange Uses

func (c *ClusterPipeline) ZRange(key string, start, stop int64) *StringSliceCmd

func (*ClusterPipeline) ZRangeByLex Uses

func (c *ClusterPipeline) ZRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd

func (*ClusterPipeline) ZRangeByScore Uses

func (c *ClusterPipeline) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd

func (*ClusterPipeline) ZRangeByScoreWithScores Uses

func (c *ClusterPipeline) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd

func (*ClusterPipeline) ZRangeWithScores Uses

func (c *ClusterPipeline) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd

func (*ClusterPipeline) ZRank Uses

func (c *ClusterPipeline) ZRank(key, member string) *IntCmd

func (*ClusterPipeline) ZRem Uses

func (c *ClusterPipeline) ZRem(key string, members ...string) *IntCmd

func (*ClusterPipeline) ZRemRangeByRank Uses

func (c *ClusterPipeline) ZRemRangeByRank(key string, start, stop int64) *IntCmd

func (*ClusterPipeline) ZRemRangeByScore Uses

func (c *ClusterPipeline) ZRemRangeByScore(key, min, max string) *IntCmd

func (*ClusterPipeline) ZRevRange Uses

func (c *ClusterPipeline) ZRevRange(key string, start, stop int64) *StringSliceCmd

func (*ClusterPipeline) ZRevRangeByLex Uses

func (c *ClusterPipeline) ZRevRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd

func (*ClusterPipeline) ZRevRangeByScore Uses

func (c *ClusterPipeline) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd

func (*ClusterPipeline) ZRevRangeByScoreWithScores Uses

func (c *ClusterPipeline) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd

func (*ClusterPipeline) ZRevRangeWithScores Uses

func (c *ClusterPipeline) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd

func (*ClusterPipeline) ZRevRank Uses

func (c *ClusterPipeline) ZRevRank(key, member string) *IntCmd

func (*ClusterPipeline) ZScan Uses

func (c *ClusterPipeline) ZScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*ClusterPipeline) ZScore Uses

func (c *ClusterPipeline) ZScore(key, member string) *FloatCmd

func (*ClusterPipeline) ZUnionStore Uses

func (c *ClusterPipeline) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd

type ClusterSlotCmd Uses

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

TODO: rename to ClusterSlotsCmd

func NewClusterSlotCmd Uses

func NewClusterSlotCmd(args ...interface{}) *ClusterSlotCmd

func (*ClusterSlotCmd) Err Uses

func (cmd *ClusterSlotCmd) Err() error

func (*ClusterSlotCmd) Result Uses

func (cmd *ClusterSlotCmd) Result() ([]ClusterSlotInfo, error)

func (*ClusterSlotCmd) String Uses

func (cmd *ClusterSlotCmd) String() string

func (*ClusterSlotCmd) Val Uses

func (cmd *ClusterSlotCmd) Val() []ClusterSlotInfo

type ClusterSlotInfo Uses

type ClusterSlotInfo struct {
    Start int
    End   int
    Addrs []string
}

TODO: rename to ClusterSlot

type Cmd Uses

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

func NewCmd Uses

func NewCmd(args ...interface{}) *Cmd

func (*Cmd) Err Uses

func (cmd *Cmd) Err() error

func (*Cmd) Result Uses

func (cmd *Cmd) Result() (interface{}, error)

func (*Cmd) String Uses

func (cmd *Cmd) String() string

func (*Cmd) Val Uses

func (cmd *Cmd) Val() interface{}

type Cmder Uses

type Cmder interface {
    Err() error
    fmt.Stringer
    // contains filtered or unexported methods
}

type DurationCmd Uses

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

func NewDurationCmd Uses

func NewDurationCmd(precision time.Duration, args ...interface{}) *DurationCmd

func (*DurationCmd) Err Uses

func (cmd *DurationCmd) Err() error

func (*DurationCmd) Result Uses

func (cmd *DurationCmd) Result() (time.Duration, error)

func (*DurationCmd) String Uses

func (cmd *DurationCmd) String() string

func (*DurationCmd) Val Uses

func (cmd *DurationCmd) Val() time.Duration

type FailoverOptions Uses

type FailoverOptions struct {
    // The master name.
    MasterName string
    // A seed list of host:port addresses of sentinel nodes.
    SentinelAddrs []string

    Password string
    DB       int64

    MaxRetries int

    DialTimeout  time.Duration
    ReadTimeout  time.Duration
    WriteTimeout time.Duration

    PoolSize           int
    PoolTimeout        time.Duration
    IdleTimeout        time.Duration
    IdleCheckFrequency time.Duration
}

FailoverOptions are used to configure a failover client and should be passed to NewFailoverClient.

type FloatCmd Uses

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

func NewFloatCmd Uses

func NewFloatCmd(args ...interface{}) *FloatCmd

func (*FloatCmd) Err Uses

func (cmd *FloatCmd) Err() error

func (*FloatCmd) Result Uses

func (cmd *FloatCmd) Result() (float64, error)

func (*FloatCmd) String Uses

func (cmd *FloatCmd) String() string

func (*FloatCmd) Val Uses

func (cmd *FloatCmd) Val() float64

type GeoLocation Uses

type GeoLocation struct {
    Name                      string
    Longitude, Latitude, Dist float64
    GeoHash                   int64
}

GeoLocation is used with GeoAdd to add geospatial location.

type GeoLocationCmd Uses

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

func NewGeoLocationCmd Uses

func NewGeoLocationCmd(q *GeoRadiusQuery, args ...interface{}) *GeoLocationCmd

func (*GeoLocationCmd) Err Uses

func (cmd *GeoLocationCmd) Err() error

func (*GeoLocationCmd) Result Uses

func (cmd *GeoLocationCmd) Result() ([]GeoLocation, error)

func (*GeoLocationCmd) String Uses

func (cmd *GeoLocationCmd) String() string

func (*GeoLocationCmd) Val Uses

func (cmd *GeoLocationCmd) Val() []GeoLocation

type GeoRadiusQuery Uses

type GeoRadiusQuery struct {
    Radius float64
    // Can be m, km, ft, or mi. Default is km.
    Unit        string
    WithCoord   bool
    WithDist    bool
    WithGeoHash bool
    Count       int
    // Can be ASC or DESC. Default is no sort order.
    Sort string
}

GeoRadiusQuery is used with GeoRadius to query geospatial index.

type IntCmd Uses

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

func NewIntCmd Uses

func NewIntCmd(args ...interface{}) *IntCmd

func (*IntCmd) Err Uses

func (cmd *IntCmd) Err() error

func (*IntCmd) Result Uses

func (cmd *IntCmd) Result() (int64, error)

func (*IntCmd) String Uses

func (cmd *IntCmd) String() string

func (*IntCmd) Val Uses

func (cmd *IntCmd) Val() int64

type Message Uses

type Message struct {
    Channel string
    Pattern string
    Payload string
}

Message received as result of a PUBLISH command issued by another client.

func (*Message) String Uses

func (m *Message) String() string

type Multi Uses

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

Multi implements Redis transactions as described in http://redis.io/topics/transactions. It's NOT safe for concurrent use by multiple goroutines, because Exec resets list of watched keys. If you don't need WATCH it is better to use Pipeline.

TODO(vmihailenco): rename to Tx and rework API

func (*Multi) Append Uses

func (c *Multi) Append(key, value string) *IntCmd

func (*Multi) Auth Uses

func (c *Multi) Auth(password string) *StatusCmd

func (*Multi) BLPop Uses

func (c *Multi) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd

func (*Multi) BRPop Uses

func (c *Multi) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd

func (*Multi) BRPopLPush Uses

func (c *Multi) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd

func (*Multi) BgRewriteAOF Uses

func (c *Multi) BgRewriteAOF() *StatusCmd

func (*Multi) BgSave Uses

func (c *Multi) BgSave() *StatusCmd

func (*Multi) BitCount Uses

func (c *Multi) BitCount(key string, bitCount *BitCount) *IntCmd

func (*Multi) BitOpAnd Uses

func (c *Multi) BitOpAnd(destKey string, keys ...string) *IntCmd

func (*Multi) BitOpNot Uses

func (c *Multi) BitOpNot(destKey string, key string) *IntCmd

func (*Multi) BitOpOr Uses

func (c *Multi) BitOpOr(destKey string, keys ...string) *IntCmd

func (*Multi) BitOpXor Uses

func (c *Multi) BitOpXor(destKey string, keys ...string) *IntCmd

func (*Multi) BitPos Uses

func (c *Multi) BitPos(key string, bit int64, pos ...int64) *IntCmd

func (*Multi) ClientKill Uses

func (c *Multi) ClientKill(ipPort string) *StatusCmd

func (*Multi) ClientList Uses

func (c *Multi) ClientList() *StringCmd

func (*Multi) ClientPause Uses

func (c *Multi) ClientPause(dur time.Duration) *BoolCmd

func (*Multi) ClientSetName Uses

func (c *Multi) ClientSetName(name string) *BoolCmd

ClientSetName assigns a name to the one of many connections in the pool.

func (*Multi) Close Uses

func (c *Multi) Close() error

Close closes the client, releasing any open resources.

func (*Multi) ClusterAddSlots Uses

func (c *Multi) ClusterAddSlots(slots ...int) *StatusCmd

func (*Multi) ClusterAddSlotsRange Uses

func (c *Multi) ClusterAddSlotsRange(min, max int) *StatusCmd

func (*Multi) ClusterCountFailureReports Uses

func (c *Multi) ClusterCountFailureReports(nodeID string) *IntCmd

func (*Multi) ClusterCountKeysInSlot Uses

func (c *Multi) ClusterCountKeysInSlot(slot int) *IntCmd

func (*Multi) ClusterDelSlots Uses

func (c *Multi) ClusterDelSlots(slots ...int) *StatusCmd

func (*Multi) ClusterDelSlotsRange Uses

func (c *Multi) ClusterDelSlotsRange(min, max int) *StatusCmd

func (*Multi) ClusterFailover Uses

func (c *Multi) ClusterFailover() *StatusCmd

func (*Multi) ClusterForget Uses

func (c *Multi) ClusterForget(nodeID string) *StatusCmd

func (*Multi) ClusterInfo Uses

func (c *Multi) ClusterInfo() *StringCmd

func (*Multi) ClusterKeySlot Uses

func (c *Multi) ClusterKeySlot(key string) *IntCmd

func (*Multi) ClusterMeet Uses

func (c *Multi) ClusterMeet(host, port string) *StatusCmd

func (*Multi) ClusterNodes Uses

func (c *Multi) ClusterNodes() *StringCmd

func (*Multi) ClusterReplicate Uses

func (c *Multi) ClusterReplicate(nodeID string) *StatusCmd

func (*Multi) ClusterResetHard Uses

func (c *Multi) ClusterResetHard() *StatusCmd

func (*Multi) ClusterResetSoft Uses

func (c *Multi) ClusterResetSoft() *StatusCmd

func (*Multi) ClusterSaveConfig Uses

func (c *Multi) ClusterSaveConfig() *StatusCmd

func (*Multi) ClusterSlaves Uses

func (c *Multi) ClusterSlaves(nodeID string) *StringSliceCmd

func (*Multi) ClusterSlots Uses

func (c *Multi) ClusterSlots() *ClusterSlotCmd

func (*Multi) ConfigGet Uses

func (c *Multi) ConfigGet(parameter string) *SliceCmd

func (*Multi) ConfigResetStat Uses

func (c *Multi) ConfigResetStat() *StatusCmd

func (*Multi) ConfigSet Uses

func (c *Multi) ConfigSet(parameter, value string) *StatusCmd

func (*Multi) DbSize Uses

func (c *Multi) DbSize() *IntCmd

func (*Multi) DebugObject Uses

func (c *Multi) DebugObject(key string) *StringCmd

func (*Multi) Decr Uses

func (c *Multi) Decr(key string) *IntCmd

func (*Multi) DecrBy Uses

func (c *Multi) DecrBy(key string, decrement int64) *IntCmd

func (*Multi) Del Uses

func (c *Multi) Del(keys ...string) *IntCmd

func (*Multi) Discard Uses

func (c *Multi) Discard() error

Discard discards queued commands.

func (*Multi) Dump Uses

func (c *Multi) Dump(key string) *StringCmd

func (*Multi) Echo Uses

func (c *Multi) Echo(message string) *StringCmd

func (*Multi) Eval Uses

func (c *Multi) Eval(script string, keys []string, args []string) *Cmd

func (*Multi) EvalSha Uses

func (c *Multi) EvalSha(sha1 string, keys []string, args []string) *Cmd

func (*Multi) Exec Uses

func (c *Multi) Exec(f func() error) ([]Cmder, error)

Exec executes all previously queued commands in a transaction and restores the connection state to normal.

When using WATCH, EXEC will execute commands only if the watched keys were not modified, allowing for a check-and-set mechanism.

Exec always returns list of commands. If transaction fails TxFailedErr is returned. Otherwise Exec returns error of the first failed command or nil.

func (*Multi) Exists Uses

func (c *Multi) Exists(key string) *BoolCmd

func (*Multi) Expire Uses

func (c *Multi) Expire(key string, expiration time.Duration) *BoolCmd

func (*Multi) ExpireAt Uses

func (c *Multi) ExpireAt(key string, tm time.Time) *BoolCmd

func (*Multi) FlushAll Uses

func (c *Multi) FlushAll() *StatusCmd

func (*Multi) FlushDb Uses

func (c *Multi) FlushDb() *StatusCmd

func (*Multi) GeoAdd Uses

func (c *Multi) GeoAdd(key string, geoLocation ...*GeoLocation) *IntCmd

func (*Multi) GeoDist Uses

func (c *Multi) GeoDist(key string, member1, member2, unit string) *FloatCmd

func (*Multi) GeoHash Uses

func (c *Multi) GeoHash(key string, members ...string) *StringSliceCmd

func (*Multi) GeoRadius Uses

func (c *Multi) GeoRadius(key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd

func (*Multi) GeoRadiusByMember Uses

func (c *Multi) GeoRadiusByMember(key, member string, query *GeoRadiusQuery) *GeoLocationCmd

func (*Multi) Get Uses

func (c *Multi) Get(key string) *StringCmd

func (*Multi) GetBit Uses

func (c *Multi) GetBit(key string, offset int64) *IntCmd

func (*Multi) GetRange Uses

func (c *Multi) GetRange(key string, start, end int64) *StringCmd

func (*Multi) GetSet Uses

func (c *Multi) GetSet(key string, value interface{}) *StringCmd

func (*Multi) HDel Uses

func (c *Multi) HDel(key string, fields ...string) *IntCmd

func (*Multi) HExists Uses

func (c *Multi) HExists(key, field string) *BoolCmd

func (*Multi) HGet Uses

func (c *Multi) HGet(key, field string) *StringCmd

func (*Multi) HGetAll Uses

func (c *Multi) HGetAll(key string) *StringSliceCmd

func (*Multi) HGetAllMap Uses

func (c *Multi) HGetAllMap(key string) *StringStringMapCmd

func (*Multi) HIncrBy Uses

func (c *Multi) HIncrBy(key, field string, incr int64) *IntCmd

func (*Multi) HIncrByFloat Uses

func (c *Multi) HIncrByFloat(key, field string, incr float64) *FloatCmd

func (*Multi) HKeys Uses

func (c *Multi) HKeys(key string) *StringSliceCmd

func (*Multi) HLen Uses

func (c *Multi) HLen(key string) *IntCmd

func (*Multi) HMGet Uses

func (c *Multi) HMGet(key string, fields ...string) *SliceCmd

func (*Multi) HMSet Uses

func (c *Multi) HMSet(key, field, value string, pairs ...string) *StatusCmd

func (*Multi) HMSetMap Uses

func (c *Multi) HMSetMap(key string, fields map[string]string) *StatusCmd

func (*Multi) HScan Uses

func (c *Multi) HScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*Multi) HSet Uses

func (c *Multi) HSet(key, field, value string) *BoolCmd

func (*Multi) HSetNX Uses

func (c *Multi) HSetNX(key, field, value string) *BoolCmd

func (*Multi) HVals Uses

func (c *Multi) HVals(key string) *StringSliceCmd

func (*Multi) Incr Uses

func (c *Multi) Incr(key string) *IntCmd

func (*Multi) IncrBy Uses

func (c *Multi) IncrBy(key string, value int64) *IntCmd

func (*Multi) IncrByFloat Uses

func (c *Multi) IncrByFloat(key string, value float64) *FloatCmd

func (*Multi) Info Uses

func (c *Multi) Info(section ...string) *StringCmd

func (*Multi) Keys Uses

func (c *Multi) Keys(pattern string) *StringSliceCmd

func (*Multi) LIndex Uses

func (c *Multi) LIndex(key string, index int64) *StringCmd

func (*Multi) LInsert Uses

func (c *Multi) LInsert(key, op, pivot, value string) *IntCmd

func (*Multi) LLen Uses

func (c *Multi) LLen(key string) *IntCmd

func (*Multi) LPop Uses

func (c *Multi) LPop(key string) *StringCmd

func (*Multi) LPush Uses

func (c *Multi) LPush(key string, values ...string) *IntCmd

func (*Multi) LPushX Uses

func (c *Multi) LPushX(key, value interface{}) *IntCmd

func (*Multi) LRange Uses

func (c *Multi) LRange(key string, start, stop int64) *StringSliceCmd

func (*Multi) LRem Uses

func (c *Multi) LRem(key string, count int64, value interface{}) *IntCmd

func (*Multi) LSet Uses

func (c *Multi) LSet(key string, index int64, value interface{}) *StatusCmd

func (*Multi) LTrim Uses

func (c *Multi) LTrim(key string, start, stop int64) *StatusCmd

func (*Multi) LastSave Uses

func (c *Multi) LastSave() *IntCmd

func (*Multi) MGet Uses

func (c *Multi) MGet(keys ...string) *SliceCmd

func (*Multi) MSet Uses

func (c *Multi) MSet(pairs ...string) *StatusCmd

func (*Multi) MSetNX Uses

func (c *Multi) MSetNX(pairs ...string) *BoolCmd

func (*Multi) Migrate Uses

func (c *Multi) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd

func (*Multi) Move Uses

func (c *Multi) Move(key string, db int64) *BoolCmd

func (*Multi) ObjectEncoding Uses

func (c *Multi) ObjectEncoding(keys ...string) *StringCmd

func (*Multi) ObjectIdleTime Uses

func (c *Multi) ObjectIdleTime(keys ...string) *DurationCmd

func (*Multi) ObjectRefCount Uses

func (c *Multi) ObjectRefCount(keys ...string) *IntCmd

func (*Multi) PExpire Uses

func (c *Multi) PExpire(key string, expiration time.Duration) *BoolCmd

func (*Multi) PExpireAt Uses

func (c *Multi) PExpireAt(key string, tm time.Time) *BoolCmd

func (*Multi) PFAdd Uses

func (c *Multi) PFAdd(key string, fields ...string) *IntCmd

func (*Multi) PFCount Uses

func (c *Multi) PFCount(keys ...string) *IntCmd

func (*Multi) PFMerge Uses

func (c *Multi) PFMerge(dest string, keys ...string) *StatusCmd

func (*Multi) PTTL Uses

func (c *Multi) PTTL(key string) *DurationCmd

func (*Multi) Persist Uses

func (c *Multi) Persist(key string) *BoolCmd

func (*Multi) Ping Uses

func (c *Multi) Ping() *StatusCmd

func (*Multi) Process Uses

func (c *Multi) Process(cmd Cmder)

func (*Multi) PubSubChannels Uses

func (c *Multi) PubSubChannels(pattern string) *StringSliceCmd

func (*Multi) PubSubNumPat Uses

func (c *Multi) PubSubNumPat() *IntCmd

func (*Multi) PubSubNumSub Uses

func (c *Multi) PubSubNumSub(channels ...string) *StringIntMapCmd

func (*Multi) Quit Uses

func (c *Multi) Quit() *StatusCmd

func (*Multi) RPop Uses

func (c *Multi) RPop(key string) *StringCmd

func (*Multi) RPopLPush Uses

func (c *Multi) RPopLPush(source, destination string) *StringCmd

func (*Multi) RPush Uses

func (c *Multi) RPush(key string, values ...string) *IntCmd

func (*Multi) RPushX Uses

func (c *Multi) RPushX(key string, value interface{}) *IntCmd

func (*Multi) RandomKey Uses

func (c *Multi) RandomKey() *StringCmd

func (*Multi) ReadWrite Uses

func (c *Multi) ReadWrite() *StatusCmd

func (*Multi) Readonly Uses

func (c *Multi) Readonly() *StatusCmd

func (*Multi) Rename Uses

func (c *Multi) Rename(key, newkey string) *StatusCmd

func (*Multi) RenameNX Uses

func (c *Multi) RenameNX(key, newkey string) *BoolCmd

func (*Multi) Restore Uses

func (c *Multi) Restore(key string, ttl time.Duration, value string) *StatusCmd

func (*Multi) RestoreReplace Uses

func (c *Multi) RestoreReplace(key string, ttl time.Duration, value string) *StatusCmd

func (*Multi) SAdd Uses

func (c *Multi) SAdd(key string, members ...string) *IntCmd

func (*Multi) SCard Uses

func (c *Multi) SCard(key string) *IntCmd

func (*Multi) SDiff Uses

func (c *Multi) SDiff(keys ...string) *StringSliceCmd

func (*Multi) SDiffStore Uses

func (c *Multi) SDiffStore(destination string, keys ...string) *IntCmd

func (*Multi) SInter Uses

func (c *Multi) SInter(keys ...string) *StringSliceCmd

func (*Multi) SInterStore Uses

func (c *Multi) SInterStore(destination string, keys ...string) *IntCmd

func (*Multi) SIsMember Uses

func (c *Multi) SIsMember(key string, member interface{}) *BoolCmd

func (*Multi) SMembers Uses

func (c *Multi) SMembers(key string) *StringSliceCmd

func (*Multi) SMove Uses

func (c *Multi) SMove(source, destination string, member interface{}) *BoolCmd

func (*Multi) SPop Uses

func (c *Multi) SPop(key string) *StringCmd

Redis `SPOP key` command.

func (*Multi) SPopN Uses

func (c *Multi) SPopN(key string, count int64) *StringSliceCmd

Redis `SPOP key count` command.

func (*Multi) SRandMember Uses

func (c *Multi) SRandMember(key string) *StringCmd

Redis `SRANDMEMBER key` command.

func (*Multi) SRandMemberN Uses

func (c *Multi) SRandMemberN(key string, count int64) *StringSliceCmd

Redis `SRANDMEMBER key count` command.

func (*Multi) SRem Uses

func (c *Multi) SRem(key string, members ...string) *IntCmd

func (*Multi) SScan Uses

func (c *Multi) SScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*Multi) SUnion Uses

func (c *Multi) SUnion(keys ...string) *StringSliceCmd

func (*Multi) SUnionStore Uses

func (c *Multi) SUnionStore(destination string, keys ...string) *IntCmd

func (*Multi) Save Uses

func (c *Multi) Save() *StatusCmd

func (*Multi) Scan Uses

func (c *Multi) Scan(cursor int64, match string, count int64) *ScanCmd

func (*Multi) ScriptExists Uses

func (c *Multi) ScriptExists(scripts ...string) *BoolSliceCmd

func (*Multi) ScriptFlush Uses

func (c *Multi) ScriptFlush() *StatusCmd

func (*Multi) ScriptKill Uses

func (c *Multi) ScriptKill() *StatusCmd

func (*Multi) ScriptLoad Uses

func (c *Multi) ScriptLoad(script string) *StringCmd

func (*Multi) Select Uses

func (c *Multi) Select(index int64) *StatusCmd

func (*Multi) Set Uses

func (c *Multi) Set(key string, value interface{}, expiration time.Duration) *StatusCmd

Redis `SET key value [expiration]` command.

Zero expiration means the key has no expiration time.

func (*Multi) SetBit Uses

func (c *Multi) SetBit(key string, offset int64, value int) *IntCmd

func (*Multi) SetNX Uses

func (c *Multi) SetNX(key string, value interface{}, expiration time.Duration) *BoolCmd

Redis `SET key value [expiration] NX` command.

Zero expiration means the key has no expiration time.

func (*Multi) SetRange Uses

func (c *Multi) SetRange(key string, offset int64, value string) *IntCmd

func (*Multi) SetXX Uses

func (c *Multi) SetXX(key string, value interface{}, expiration time.Duration) *BoolCmd

Redis `SET key value [expiration] XX` command.

Zero expiration means the key has no expiration time.

func (*Multi) Shutdown Uses

func (c *Multi) Shutdown() *StatusCmd

func (*Multi) ShutdownNoSave Uses

func (c *Multi) ShutdownNoSave() *StatusCmd

func (*Multi) ShutdownSave Uses

func (c *Multi) ShutdownSave() *StatusCmd

func (*Multi) SlaveOf Uses

func (c *Multi) SlaveOf(host, port string) *StatusCmd

func (*Multi) SlowLog Uses

func (c *Multi) SlowLog()

func (*Multi) Sort Uses

func (c *Multi) Sort(key string, sort Sort) *StringSliceCmd

func (*Multi) SortInterfaces Uses

func (c *Multi) SortInterfaces(key string, sort Sort) *SliceCmd

func (*Multi) StrLen Uses

func (c *Multi) StrLen(key string) *IntCmd

func (*Multi) Sync Uses

func (c *Multi) Sync()

func (*Multi) TTL Uses

func (c *Multi) TTL(key string) *DurationCmd

func (*Multi) Time Uses

func (c *Multi) Time() *StringSliceCmd

func (*Multi) Type Uses

func (c *Multi) Type(key string) *StatusCmd

func (*Multi) Unwatch Uses

func (c *Multi) Unwatch(keys ...string) *StatusCmd

Unwatch flushes all the previously watched keys for a transaction.

func (*Multi) Watch Uses

func (c *Multi) Watch(keys ...string) *StatusCmd

Watch marks the keys to be watched for conditional execution of a transaction.

func (*Multi) ZAdd Uses

func (c *Multi) ZAdd(key string, members ...Z) *IntCmd

Redis `ZADD key score member [score member ...]` command.

func (*Multi) ZAddCh Uses

func (c *Multi) ZAddCh(key string, members ...Z) *IntCmd

Redis `ZADD key CH score member [score member ...]` command.

func (*Multi) ZAddNX Uses

func (c *Multi) ZAddNX(key string, members ...Z) *IntCmd

Redis `ZADD key NX score member [score member ...]` command.

func (*Multi) ZAddNXCh Uses

func (c *Multi) ZAddNXCh(key string, members ...Z) *IntCmd

Redis `ZADD key NX CH score member [score member ...]` command.

func (*Multi) ZAddXX Uses

func (c *Multi) ZAddXX(key string, members ...Z) *IntCmd

Redis `ZADD key XX score member [score member ...]` command.

func (*Multi) ZAddXXCh Uses

func (c *Multi) ZAddXXCh(key string, members ...Z) *IntCmd

Redis `ZADD key XX CH score member [score member ...]` command.

func (*Multi) ZCard Uses

func (c *Multi) ZCard(key string) *IntCmd

func (*Multi) ZCount Uses

func (c *Multi) ZCount(key, min, max string) *IntCmd

func (*Multi) ZIncr Uses

func (c *Multi) ZIncr(key string, member Z) *FloatCmd

Redis `ZADD key INCR score member` command.

func (*Multi) ZIncrBy Uses

func (c *Multi) ZIncrBy(key string, increment float64, member string) *FloatCmd

func (*Multi) ZIncrNX Uses

func (c *Multi) ZIncrNX(key string, member Z) *FloatCmd

Redis `ZADD key NX INCR score member` command.

func (*Multi) ZIncrXX Uses

func (c *Multi) ZIncrXX(key string, member Z) *FloatCmd

Redis `ZADD key XX INCR score member` command.

func (*Multi) ZInterStore Uses

func (c *Multi) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd

func (*Multi) ZRange Uses

func (c *Multi) ZRange(key string, start, stop int64) *StringSliceCmd

func (*Multi) ZRangeByLex Uses

func (c *Multi) ZRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd

func (*Multi) ZRangeByScore Uses

func (c *Multi) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd

func (*Multi) ZRangeByScoreWithScores Uses

func (c *Multi) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd

func (*Multi) ZRangeWithScores Uses

func (c *Multi) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd

func (*Multi) ZRank Uses

func (c *Multi) ZRank(key, member string) *IntCmd

func (*Multi) ZRem Uses

func (c *Multi) ZRem(key string, members ...string) *IntCmd

func (*Multi) ZRemRangeByRank Uses

func (c *Multi) ZRemRangeByRank(key string, start, stop int64) *IntCmd

func (*Multi) ZRemRangeByScore Uses

func (c *Multi) ZRemRangeByScore(key, min, max string) *IntCmd

func (*Multi) ZRevRange Uses

func (c *Multi) ZRevRange(key string, start, stop int64) *StringSliceCmd

func (*Multi) ZRevRangeByLex Uses

func (c *Multi) ZRevRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd

func (*Multi) ZRevRangeByScore Uses

func (c *Multi) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd

func (*Multi) ZRevRangeByScoreWithScores Uses

func (c *Multi) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd

func (*Multi) ZRevRangeWithScores Uses

func (c *Multi) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd

func (*Multi) ZRevRank Uses

func (c *Multi) ZRevRank(key, member string) *IntCmd

func (*Multi) ZScan Uses

func (c *Multi) ZScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*Multi) ZScore Uses

func (c *Multi) ZScore(key, member string) *FloatCmd

func (*Multi) ZUnionStore Uses

func (c *Multi) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd

type Options Uses

type Options struct {
    // The network type, either tcp or unix.
    // Default is tcp.
    Network string
    // host:port address.
    Addr string

    // Dialer creates new network connection and has priority over
    // Network and Addr options.
    Dialer func() (net.Conn, error)

    // An optional password. Must match the password specified in the
    // requirepass server configuration option.
    Password string
    // A database to be selected after connecting to server.
    DB  int64

    // The maximum number of retries before giving up.
    // Default is to not retry failed commands.
    MaxRetries int

    // Sets the deadline for establishing new connections. If reached,
    // dial will fail with a timeout.
    // Default is 5 seconds.
    DialTimeout time.Duration
    // Sets the deadline for socket reads. If reached, commands will
    // fail with a timeout instead of blocking.
    ReadTimeout time.Duration
    // Sets the deadline for socket writes. If reached, commands will
    // fail with a timeout instead of blocking.
    WriteTimeout time.Duration

    // The maximum number of socket connections.
    // Default is 10 connections.
    PoolSize int
    // Specifies amount of time client waits for connection if all
    // connections are busy before returning an error.
    // Default is 1 second.
    PoolTimeout time.Duration
    // Specifies amount of time after which client closes idle
    // connections. Should be less than server's timeout.
    // Default is to not close idle connections.
    IdleTimeout time.Duration
    // The frequency of idle checks.
    // Default is 1 minute.
    IdleCheckFrequency time.Duration
}

type PMessage Uses

type PMessage struct {
    Channel string
    Pattern string
    Payload string
}

Message matching a pattern-matching subscription received as result of a PUBLISH command issued by another client.

func (*PMessage) String Uses

func (m *PMessage) String() string

type Pipeline Uses

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

Pipeline implements pipelining as described in http://redis.io/topics/pipelining. It's safe for concurrent use by multiple goroutines.

Code:

pipe := client.Pipeline()
defer pipe.Close()

incr := pipe.Incr("counter2")
pipe.Expire("counter2", time.Hour)
_, err := pipe.Exec()
fmt.Println(incr.Val(), err)

Output:

1 <nil>

func (*Pipeline) Append Uses

func (c *Pipeline) Append(key, value string) *IntCmd

func (*Pipeline) Auth Uses

func (c *Pipeline) Auth(password string) *StatusCmd

func (*Pipeline) BLPop Uses

func (c *Pipeline) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd

func (*Pipeline) BRPop Uses

func (c *Pipeline) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd

func (*Pipeline) BRPopLPush Uses

func (c *Pipeline) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd

func (*Pipeline) BgRewriteAOF Uses

func (c *Pipeline) BgRewriteAOF() *StatusCmd

func (*Pipeline) BgSave Uses

func (c *Pipeline) BgSave() *StatusCmd

func (*Pipeline) BitCount Uses

func (c *Pipeline) BitCount(key string, bitCount *BitCount) *IntCmd

func (*Pipeline) BitOpAnd Uses

func (c *Pipeline) BitOpAnd(destKey string, keys ...string) *IntCmd

func (*Pipeline) BitOpNot Uses

func (c *Pipeline) BitOpNot(destKey string, key string) *IntCmd

func (*Pipeline) BitOpOr Uses

func (c *Pipeline) BitOpOr(destKey string, keys ...string) *IntCmd

func (*Pipeline) BitOpXor Uses

func (c *Pipeline) BitOpXor(destKey string, keys ...string) *IntCmd

func (*Pipeline) BitPos Uses

func (c *Pipeline) BitPos(key string, bit int64, pos ...int64) *IntCmd

func (*Pipeline) ClientKill Uses

func (c *Pipeline) ClientKill(ipPort string) *StatusCmd

func (*Pipeline) ClientList Uses

func (c *Pipeline) ClientList() *StringCmd

func (*Pipeline) ClientPause Uses

func (c *Pipeline) ClientPause(dur time.Duration) *BoolCmd

func (*Pipeline) ClientSetName Uses

func (c *Pipeline) ClientSetName(name string) *BoolCmd

ClientSetName assigns a name to the one of many connections in the pool.

func (*Pipeline) Close Uses

func (pipe *Pipeline) Close() error

Close closes the pipeline, releasing any open resources.

func (*Pipeline) ClusterAddSlots Uses

func (c *Pipeline) ClusterAddSlots(slots ...int) *StatusCmd

func (*Pipeline) ClusterAddSlotsRange Uses

func (c *Pipeline) ClusterAddSlotsRange(min, max int) *StatusCmd

func (*Pipeline) ClusterCountFailureReports Uses

func (c *Pipeline) ClusterCountFailureReports(nodeID string) *IntCmd

func (*Pipeline) ClusterCountKeysInSlot Uses

func (c *Pipeline) ClusterCountKeysInSlot(slot int) *IntCmd

func (*Pipeline) ClusterDelSlots Uses

func (c *Pipeline) ClusterDelSlots(slots ...int) *StatusCmd

func (*Pipeline) ClusterDelSlotsRange Uses

func (c *Pipeline) ClusterDelSlotsRange(min, max int) *StatusCmd

func (*Pipeline) ClusterFailover Uses

func (c *Pipeline) ClusterFailover() *StatusCmd

func (*Pipeline) ClusterForget Uses

func (c *Pipeline) ClusterForget(nodeID string) *StatusCmd

func (*Pipeline) ClusterInfo Uses

func (c *Pipeline) ClusterInfo() *StringCmd

func (*Pipeline) ClusterKeySlot Uses

func (c *Pipeline) ClusterKeySlot(key string) *IntCmd

func (*Pipeline) ClusterMeet Uses

func (c *Pipeline) ClusterMeet(host, port string) *StatusCmd

func (*Pipeline) ClusterNodes Uses

func (c *Pipeline) ClusterNodes() *StringCmd

func (*Pipeline) ClusterReplicate Uses

func (c *Pipeline) ClusterReplicate(nodeID string) *StatusCmd

func (*Pipeline) ClusterResetHard Uses

func (c *Pipeline) ClusterResetHard() *StatusCmd

func (*Pipeline) ClusterResetSoft Uses

func (c *Pipeline) ClusterResetSoft() *StatusCmd

func (*Pipeline) ClusterSaveConfig Uses

func (c *Pipeline) ClusterSaveConfig() *StatusCmd

func (*Pipeline) ClusterSlaves Uses

func (c *Pipeline) ClusterSlaves(nodeID string) *StringSliceCmd

func (*Pipeline) ClusterSlots Uses

func (c *Pipeline) ClusterSlots() *ClusterSlotCmd

func (*Pipeline) ConfigGet Uses

func (c *Pipeline) ConfigGet(parameter string) *SliceCmd

func (*Pipeline) ConfigResetStat Uses

func (c *Pipeline) ConfigResetStat() *StatusCmd

func (*Pipeline) ConfigSet Uses

func (c *Pipeline) ConfigSet(parameter, value string) *StatusCmd

func (*Pipeline) DbSize Uses

func (c *Pipeline) DbSize() *IntCmd

func (*Pipeline) DebugObject Uses

func (c *Pipeline) DebugObject(key string) *StringCmd

func (*Pipeline) Decr Uses

func (c *Pipeline) Decr(key string) *IntCmd

func (*Pipeline) DecrBy Uses

func (c *Pipeline) DecrBy(key string, decrement int64) *IntCmd

func (*Pipeline) Del Uses

func (c *Pipeline) Del(keys ...string) *IntCmd

func (*Pipeline) Discard Uses

func (pipe *Pipeline) Discard() error

Discard resets the pipeline and discards queued commands.

func (*Pipeline) Dump Uses

func (c *Pipeline) Dump(key string) *StringCmd

func (*Pipeline) Echo Uses

func (c *Pipeline) Echo(message string) *StringCmd

func (*Pipeline) Eval Uses

func (c *Pipeline) Eval(script string, keys []string, args []string) *Cmd

func (*Pipeline) EvalSha Uses

func (c *Pipeline) EvalSha(sha1 string, keys []string, args []string) *Cmd

func (*Pipeline) Exec Uses

func (pipe *Pipeline) Exec() (cmds []Cmder, retErr error)

Exec executes all previously queued commands using one client-server roundtrip.

Exec always returns list of commands and error of the first failed command if any.

func (*Pipeline) Exists Uses

func (c *Pipeline) Exists(key string) *BoolCmd

func (*Pipeline) Expire Uses

func (c *Pipeline) Expire(key string, expiration time.Duration) *BoolCmd

func (*Pipeline) ExpireAt Uses

func (c *Pipeline) ExpireAt(key string, tm time.Time) *BoolCmd

func (*Pipeline) FlushAll Uses

func (c *Pipeline) FlushAll() *StatusCmd

func (*Pipeline) FlushDb Uses

func (c *Pipeline) FlushDb() *StatusCmd

func (*Pipeline) GeoAdd Uses

func (c *Pipeline) GeoAdd(key string, geoLocation ...*GeoLocation) *IntCmd

func (*Pipeline) GeoDist Uses

func (c *Pipeline) GeoDist(key string, member1, member2, unit string) *FloatCmd

func (*Pipeline) GeoHash Uses

func (c *Pipeline) GeoHash(key string, members ...string) *StringSliceCmd

func (*Pipeline) GeoRadius Uses

func (c *Pipeline) GeoRadius(key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd

func (*Pipeline) GeoRadiusByMember Uses

func (c *Pipeline) GeoRadiusByMember(key, member string, query *GeoRadiusQuery) *GeoLocationCmd

func (*Pipeline) Get Uses

func (c *Pipeline) Get(key string) *StringCmd

func (*Pipeline) GetBit Uses

func (c *Pipeline) GetBit(key string, offset int64) *IntCmd

func (*Pipeline) GetRange Uses

func (c *Pipeline) GetRange(key string, start, end int64) *StringCmd

func (*Pipeline) GetSet Uses

func (c *Pipeline) GetSet(key string, value interface{}) *StringCmd

func (*Pipeline) HDel Uses

func (c *Pipeline) HDel(key string, fields ...string) *IntCmd

func (*Pipeline) HExists Uses

func (c *Pipeline) HExists(key, field string) *BoolCmd

func (*Pipeline) HGet Uses

func (c *Pipeline) HGet(key, field string) *StringCmd

func (*Pipeline) HGetAll Uses

func (c *Pipeline) HGetAll(key string) *StringSliceCmd

func (*Pipeline) HGetAllMap Uses

func (c *Pipeline) HGetAllMap(key string) *StringStringMapCmd

func (*Pipeline) HIncrBy Uses

func (c *Pipeline) HIncrBy(key, field string, incr int64) *IntCmd

func (*Pipeline) HIncrByFloat Uses

func (c *Pipeline) HIncrByFloat(key, field string, incr float64) *FloatCmd

func (*Pipeline) HKeys Uses

func (c *Pipeline) HKeys(key string) *StringSliceCmd

func (*Pipeline) HLen Uses

func (c *Pipeline) HLen(key string) *IntCmd

func (*Pipeline) HMGet Uses

func (c *Pipeline) HMGet(key string, fields ...string) *SliceCmd

func (*Pipeline) HMSet Uses

func (c *Pipeline) HMSet(key, field, value string, pairs ...string) *StatusCmd

func (*Pipeline) HMSetMap Uses

func (c *Pipeline) HMSetMap(key string, fields map[string]string) *StatusCmd

func (*Pipeline) HScan Uses

func (c *Pipeline) HScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*Pipeline) HSet Uses

func (c *Pipeline) HSet(key, field, value string) *BoolCmd

func (*Pipeline) HSetNX Uses

func (c *Pipeline) HSetNX(key, field, value string) *BoolCmd

func (*Pipeline) HVals Uses

func (c *Pipeline) HVals(key string) *StringSliceCmd

func (*Pipeline) Incr Uses

func (c *Pipeline) Incr(key string) *IntCmd

func (*Pipeline) IncrBy Uses

func (c *Pipeline) IncrBy(key string, value int64) *IntCmd

func (*Pipeline) IncrByFloat Uses

func (c *Pipeline) IncrByFloat(key string, value float64) *FloatCmd

func (*Pipeline) Info Uses

func (c *Pipeline) Info(section ...string) *StringCmd

func (*Pipeline) Keys Uses

func (c *Pipeline) Keys(pattern string) *StringSliceCmd

func (*Pipeline) LIndex Uses

func (c *Pipeline) LIndex(key string, index int64) *StringCmd

func (*Pipeline) LInsert Uses

func (c *Pipeline) LInsert(key, op, pivot, value string) *IntCmd

func (*Pipeline) LLen Uses

func (c *Pipeline) LLen(key string) *IntCmd

func (*Pipeline) LPop Uses

func (c *Pipeline) LPop(key string) *StringCmd

func (*Pipeline) LPush Uses

func (c *Pipeline) LPush(key string, values ...string) *IntCmd

func (*Pipeline) LPushX Uses

func (c *Pipeline) LPushX(key, value interface{}) *IntCmd

func (*Pipeline) LRange Uses

func (c *Pipeline) LRange(key string, start, stop int64) *StringSliceCmd

func (*Pipeline) LRem Uses

func (c *Pipeline) LRem(key string, count int64, value interface{}) *IntCmd

func (*Pipeline) LSet Uses

func (c *Pipeline) LSet(key string, index int64, value interface{}) *StatusCmd

func (*Pipeline) LTrim Uses

func (c *Pipeline) LTrim(key string, start, stop int64) *StatusCmd

func (*Pipeline) LastSave Uses

func (c *Pipeline) LastSave() *IntCmd

func (*Pipeline) MGet Uses

func (c *Pipeline) MGet(keys ...string) *SliceCmd

func (*Pipeline) MSet Uses

func (c *Pipeline) MSet(pairs ...string) *StatusCmd

func (*Pipeline) MSetNX Uses

func (c *Pipeline) MSetNX(pairs ...string) *BoolCmd

func (*Pipeline) Migrate Uses

func (c *Pipeline) Migrate(host, port, key string, db int64, timeout time.Duration) *StatusCmd

func (*Pipeline) Move Uses

func (c *Pipeline) Move(key string, db int64) *BoolCmd

func (*Pipeline) ObjectEncoding Uses

func (c *Pipeline) ObjectEncoding(keys ...string) *StringCmd

func (*Pipeline) ObjectIdleTime Uses

func (c *Pipeline) ObjectIdleTime(keys ...string) *DurationCmd

func (*Pipeline) ObjectRefCount Uses

func (c *Pipeline) ObjectRefCount(keys ...string) *IntCmd

func (*Pipeline) PExpire Uses

func (c *Pipeline) PExpire(key string, expiration time.Duration) *BoolCmd

func (*Pipeline) PExpireAt Uses

func (c *Pipeline) PExpireAt(key string, tm time.Time) *BoolCmd

func (*Pipeline) PFAdd Uses

func (c *Pipeline) PFAdd(key string, fields ...string) *IntCmd

func (*Pipeline) PFCount Uses

func (c *Pipeline) PFCount(keys ...string) *IntCmd

func (*Pipeline) PFMerge Uses

func (c *Pipeline) PFMerge(dest string, keys ...string) *StatusCmd

func (*Pipeline) PTTL Uses

func (c *Pipeline) PTTL(key string) *DurationCmd

func (*Pipeline) Persist Uses

func (c *Pipeline) Persist(key string) *BoolCmd

func (*Pipeline) Ping Uses

func (c *Pipeline) Ping() *StatusCmd

func (*Pipeline) Process Uses

func (c *Pipeline) Process(cmd Cmder)

func (*Pipeline) PubSubChannels Uses

func (c *Pipeline) PubSubChannels(pattern string) *StringSliceCmd

func (*Pipeline) PubSubNumPat Uses

func (c *Pipeline) PubSubNumPat() *IntCmd

func (*Pipeline) PubSubNumSub Uses

func (c *Pipeline) PubSubNumSub(channels ...string) *StringIntMapCmd

func (*Pipeline) Quit Uses

func (c *Pipeline) Quit() *StatusCmd

func (*Pipeline) RPop Uses

func (c *Pipeline) RPop(key string) *StringCmd

func (*Pipeline) RPopLPush Uses

func (c *Pipeline) RPopLPush(source, destination string) *StringCmd

func (*Pipeline) RPush Uses

func (c *Pipeline) RPush(key string, values ...string) *IntCmd

func (*Pipeline) RPushX Uses

func (c *Pipeline) RPushX(key string, value interface{}) *IntCmd

func (*Pipeline) RandomKey Uses

func (c *Pipeline) RandomKey() *StringCmd

func (*Pipeline) ReadWrite Uses

func (c *Pipeline) ReadWrite() *StatusCmd

func (*Pipeline) Readonly Uses

func (c *Pipeline) Readonly() *StatusCmd

func (*Pipeline) Rename Uses

func (c *Pipeline) Rename(key, newkey string) *StatusCmd

func (*Pipeline) RenameNX Uses

func (c *Pipeline) RenameNX(key, newkey string) *BoolCmd

func (*Pipeline) Restore Uses

func (c *Pipeline) Restore(key string, ttl time.Duration, value string) *StatusCmd

func (*Pipeline) RestoreReplace Uses

func (c *Pipeline) RestoreReplace(key string, ttl time.Duration, value string) *StatusCmd

func (*Pipeline) SAdd Uses

func (c *Pipeline) SAdd(key string, members ...string) *IntCmd

func (*Pipeline) SCard Uses

func (c *Pipeline) SCard(key string) *IntCmd

func (*Pipeline) SDiff Uses

func (c *Pipeline) SDiff(keys ...string) *StringSliceCmd

func (*Pipeline) SDiffStore Uses

func (c *Pipeline) SDiffStore(destination string, keys ...string) *IntCmd

func (*Pipeline) SInter Uses

func (c *Pipeline) SInter(keys ...string) *StringSliceCmd

func (*Pipeline) SInterStore Uses

func (c *Pipeline) SInterStore(destination string, keys ...string) *IntCmd

func (*Pipeline) SIsMember Uses

func (c *Pipeline) SIsMember(key string, member interface{}) *BoolCmd

func (*Pipeline) SMembers Uses

func (c *Pipeline) SMembers(key string) *StringSliceCmd

func (*Pipeline) SMove Uses

func (c *Pipeline) SMove(source, destination string, member interface{}) *BoolCmd

func (*Pipeline) SPop Uses

func (c *Pipeline) SPop(key string) *StringCmd

Redis `SPOP key` command.

func (*Pipeline) SPopN Uses

func (c *Pipeline) SPopN(key string, count int64) *StringSliceCmd

Redis `SPOP key count` command.

func (*Pipeline) SRandMember Uses

func (c *Pipeline) SRandMember(key string) *StringCmd

Redis `SRANDMEMBER key` command.

func (*Pipeline) SRandMemberN Uses

func (c *Pipeline) SRandMemberN(key string, count int64) *StringSliceCmd

Redis `SRANDMEMBER key count` command.

func (*Pipeline) SRem Uses

func (c *Pipeline) SRem(key string, members ...string) *IntCmd

func (*Pipeline) SScan Uses

func (c *Pipeline) SScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*Pipeline) SUnion Uses

func (c *Pipeline) SUnion(keys ...string) *StringSliceCmd

func (*Pipeline) SUnionStore Uses

func (c *Pipeline) SUnionStore(destination string, keys ...string) *IntCmd

func (*Pipeline) Save Uses

func (c *Pipeline) Save() *StatusCmd

func (*Pipeline) Scan Uses

func (c *Pipeline) Scan(cursor int64, match string, count int64) *ScanCmd

func (*Pipeline) ScriptExists Uses

func (c *Pipeline) ScriptExists(scripts ...string) *BoolSliceCmd

func (*Pipeline) ScriptFlush Uses

func (c *Pipeline) ScriptFlush() *StatusCmd

func (*Pipeline) ScriptKill Uses

func (c *Pipeline) ScriptKill() *StatusCmd

func (*Pipeline) ScriptLoad Uses

func (c *Pipeline) ScriptLoad(script string) *StringCmd

func (*Pipeline) Select Uses

func (c *Pipeline) Select(index int64) *StatusCmd

func (*Pipeline) Set Uses

func (c *Pipeline) Set(key string, value interface{}, expiration time.Duration) *StatusCmd

Redis `SET key value [expiration]` command.

Zero expiration means the key has no expiration time.

func (*Pipeline) SetBit Uses

func (c *Pipeline) SetBit(key string, offset int64, value int) *IntCmd

func (*Pipeline) SetNX Uses

func (c *Pipeline) SetNX(key string, value interface{}, expiration time.Duration) *BoolCmd

Redis `SET key value [expiration] NX` command.

Zero expiration means the key has no expiration time.

func (*Pipeline) SetRange Uses

func (c *Pipeline) SetRange(key string, offset int64, value string) *IntCmd

func (*Pipeline) SetXX Uses

func (c *Pipeline) SetXX(key string, value interface{}, expiration time.Duration) *BoolCmd

Redis `SET key value [expiration] XX` command.

Zero expiration means the key has no expiration time.

func (*Pipeline) Shutdown Uses

func (c *Pipeline) Shutdown() *StatusCmd

func (*Pipeline) ShutdownNoSave Uses

func (c *Pipeline) ShutdownNoSave() *StatusCmd

func (*Pipeline) ShutdownSave Uses

func (c *Pipeline) ShutdownSave() *StatusCmd

func (*Pipeline) SlaveOf Uses

func (c *Pipeline) SlaveOf(host, port string) *StatusCmd

func (*Pipeline) SlowLog Uses

func (c *Pipeline) SlowLog()

func (*Pipeline) Sort Uses

func (c *Pipeline) Sort(key string, sort Sort) *StringSliceCmd

func (*Pipeline) SortInterfaces Uses

func (c *Pipeline) SortInterfaces(key string, sort Sort) *SliceCmd

func (*Pipeline) StrLen Uses

func (c *Pipeline) StrLen(key string) *IntCmd

func (*Pipeline) Sync Uses

func (c *Pipeline) Sync()

func (*Pipeline) TTL Uses

func (c *Pipeline) TTL(key string) *DurationCmd

func (*Pipeline) Time Uses

func (c *Pipeline) Time() *StringSliceCmd

func (*Pipeline) Type Uses

func (c *Pipeline) Type(key string) *StatusCmd

func (*Pipeline) ZAdd Uses

func (c *Pipeline) ZAdd(key string, members ...Z) *IntCmd

Redis `ZADD key score member [score member ...]` command.

func (*Pipeline) ZAddCh Uses

func (c *Pipeline) ZAddCh(key string, members ...Z) *IntCmd

Redis `ZADD key CH score member [score member ...]` command.

func (*Pipeline) ZAddNX Uses

func (c *Pipeline) ZAddNX(key string, members ...Z) *IntCmd

Redis `ZADD key NX score member [score member ...]` command.

func (*Pipeline) ZAddNXCh Uses

func (c *Pipeline) ZAddNXCh(key string, members ...Z) *IntCmd

Redis `ZADD key NX CH score member [score member ...]` command.

func (*Pipeline) ZAddXX Uses

func (c *Pipeline) ZAddXX(key string, members ...Z) *IntCmd

Redis `ZADD key XX score member [score member ...]` command.

func (*Pipeline) ZAddXXCh Uses

func (c *Pipeline) ZAddXXCh(key string, members ...Z) *IntCmd

Redis `ZADD key XX CH score member [score member ...]` command.

func (*Pipeline) ZCard Uses

func (c *Pipeline) ZCard(key string) *IntCmd

func (*Pipeline) ZCount Uses

func (c *Pipeline) ZCount(key, min, max string) *IntCmd

func (*Pipeline) ZIncr Uses

func (c *Pipeline) ZIncr(key string, member Z) *FloatCmd

Redis `ZADD key INCR score member` command.

func (*Pipeline) ZIncrBy Uses

func (c *Pipeline) ZIncrBy(key string, increment float64, member string) *FloatCmd

func (*Pipeline) ZIncrNX Uses

func (c *Pipeline) ZIncrNX(key string, member Z) *FloatCmd

Redis `ZADD key NX INCR score member` command.

func (*Pipeline) ZIncrXX Uses

func (c *Pipeline) ZIncrXX(key string, member Z) *FloatCmd

Redis `ZADD key XX INCR score member` command.

func (*Pipeline) ZInterStore Uses

func (c *Pipeline) ZInterStore(destination string, store ZStore, keys ...string) *IntCmd

func (*Pipeline) ZRange Uses

func (c *Pipeline) ZRange(key string, start, stop int64) *StringSliceCmd

func (*Pipeline) ZRangeByLex Uses

func (c *Pipeline) ZRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd

func (*Pipeline) ZRangeByScore Uses

func (c *Pipeline) ZRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd

func (*Pipeline) ZRangeByScoreWithScores Uses

func (c *Pipeline) ZRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd

func (*Pipeline) ZRangeWithScores Uses

func (c *Pipeline) ZRangeWithScores(key string, start, stop int64) *ZSliceCmd

func (*Pipeline) ZRank Uses

func (c *Pipeline) ZRank(key, member string) *IntCmd

func (*Pipeline) ZRem Uses

func (c *Pipeline) ZRem(key string, members ...string) *IntCmd

func (*Pipeline) ZRemRangeByRank Uses

func (c *Pipeline) ZRemRangeByRank(key string, start, stop int64) *IntCmd

func (*Pipeline) ZRemRangeByScore Uses

func (c *Pipeline) ZRemRangeByScore(key, min, max string) *IntCmd

func (*Pipeline) ZRevRange Uses

func (c *Pipeline) ZRevRange(key string, start, stop int64) *StringSliceCmd

func (*Pipeline) ZRevRangeByLex Uses

func (c *Pipeline) ZRevRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd

func (*Pipeline) ZRevRangeByScore Uses

func (c *Pipeline) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSliceCmd

func (*Pipeline) ZRevRangeByScoreWithScores Uses

func (c *Pipeline) ZRevRangeByScoreWithScores(key string, opt ZRangeByScore) *ZSliceCmd

func (*Pipeline) ZRevRangeWithScores Uses

func (c *Pipeline) ZRevRangeWithScores(key string, start, stop int64) *ZSliceCmd

func (*Pipeline) ZRevRank Uses

func (c *Pipeline) ZRevRank(key, member string) *IntCmd

func (*Pipeline) ZScan Uses

func (c *Pipeline) ZScan(key string, cursor int64, match string, count int64) *ScanCmd

func (*Pipeline) ZScore Uses

func (c *Pipeline) ZScore(key, member string) *FloatCmd

func (*Pipeline) ZUnionStore Uses

func (c *Pipeline) ZUnionStore(dest string, store ZStore, keys ...string) *IntCmd

type Pong Uses

type Pong struct {
    Payload string
}

Pong received as result of a PING command issued by another client.

func (*Pong) String Uses

func (p *Pong) String() string

type PoolStats Uses

type PoolStats struct {
    Requests uint32 // number of times a connection was requested by the pool
    Hits     uint32 // number of times free connection was found in the pool
    Waits    uint32 // number of times the pool had to wait for a connection
    Timeouts uint32 // number of times a wait timeout occurred

    TotalConns uint32 // the number of total connections in the pool
    FreeConns  uint32 // the number of free connections in the pool
}

PoolStats contains pool state information and accumulated stats.

type PubSub Uses

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

PubSub implements Pub/Sub commands as described in http://redis.io/topics/pubsub. It's NOT safe for concurrent use by multiple goroutines.

Code:

pubsub, err := client.Subscribe("mychannel1")
if err != nil {
    panic(err)
}
defer pubsub.Close()

err = client.Publish("mychannel1", "hello").Err()
if err != nil {
    panic(err)
}

msg, err := pubsub.ReceiveMessage()
if err != nil {
    panic(err)
}

fmt.Println(msg.Channel, msg.Payload)

Output:

mychannel1 hello

func (*PubSub) Close Uses

func (c *PubSub) Close() error

func (*PubSub) PSubscribe Uses

func (c *PubSub) PSubscribe(patterns ...string) error

Subscribes the client to the given patterns.

func (*PubSub) PUnsubscribe Uses

func (c *PubSub) PUnsubscribe(patterns ...string) error

Unsubscribes the client from the given patterns, or from all of them if none is given.

func (*PubSub) Ping Uses

func (c *PubSub) Ping(payload string) error

func (*PubSub) Receive Uses

func (c *PubSub) Receive() (interface{}, error)

Receive returns a message as a Subscription, Message, PMessage, Pong or error. See PubSub example for details. This is low-level API and most clients should use ReceiveMessage.

Code:

pubsub, err := client.Subscribe("mychannel2")
if err != nil {
    panic(err)
}
defer pubsub.Close()

n, err := client.Publish("mychannel2", "hello").Result()
if err != nil {
    panic(err)
}
fmt.Println(n, "clients received message")

for i := 0; i < 2; i++ {
    // ReceiveTimeout is a low level API. Use ReceiveMessage instead.
    msgi, err := pubsub.ReceiveTimeout(5 * time.Second)
    if err != nil {
        break
    }

    switch msg := msgi.(type) {
    case *redis.Subscription:
        fmt.Println("subscribed to", msg.Channel)
    case *redis.Message:
        fmt.Println("received", msg.Payload, "from", msg.Channel)
    default:
        panic(fmt.Errorf("unknown message: %#v", msgi))
    }
}

Output:

1 clients received message
subscribed to mychannel2
received hello from mychannel2

func (*PubSub) ReceiveMessage Uses

func (c *PubSub) ReceiveMessage() (*Message, error)

ReceiveMessage returns a Message or error ignoring Subscription or Pong messages. It automatically reconnects to Redis Server and resubscribes to channels in case of network errors.

func (*PubSub) ReceiveTimeout Uses

func (c *PubSub) ReceiveTimeout(timeout time.Duration) (interface{}, error)

ReceiveTimeout acts like Receive but returns an error if message is not received in time. This is low-level API and most clients should use ReceiveMessage.

func (*PubSub) Subscribe Uses

func (c *PubSub) Subscribe(channels ...string) error

Subscribes the client to the specified channels.

func (*PubSub) Unsubscribe Uses

func (c *PubSub) Unsubscribe(channels ...string) error

Unsubscribes the client from the given channels, or from all of them if none is given.

type Ring Uses

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

Ring is a Redis client that uses constistent hashing to distribute keys across multiple Redis servers (shards). It's safe for concurrent use by multiple goroutines.

Ring monitors the state of each shard and removes dead shards from the ring. When shard comes online it is added back to the ring. This gives you maximum availability and partition tolerance, but no consistency between different shards or even clients. Each client uses shards that are available to the client and does not do any coordination when shard state is changed.

Ring should be used when you use multiple Redis servers for caching and can tolerate losing data when one of the servers dies. Otherwise you should use Redis Cluster.

func NewRing Uses

func NewRing(opt *RingOptions) *Ring

Code:

client := redis.NewRing(&redis.RingOptions{
    Addrs: map[string]string{
        "shard1": ":7000",
        "shard2": ":7001",
        "shard3": ":7002",
    },
})
client.Ping()

func (*Ring) Append Uses

func (c *Ring) Append(key, value string) *IntCmd

func (*Ring) Auth Uses

func (c *Ring) Auth(password string) *StatusCmd

func (*Ring) BLPop Uses

func (c *Ring) BLPop(timeout time.Duration, keys ...string) *StringSliceCmd

func (*Ring) BRPop Uses

func (c *Ring) BRPop(timeout time.Duration, keys ...string) *StringSliceCmd

func (*Ring) BRPopLPush Uses

func (c *Ring) BRPopLPush(source, destination string, timeout time.Duration) *StringCmd

func (*Ring) BgRewriteAOF Uses

func (c *Ring) BgRewriteAOF() *StatusCmd

func (*Ring) BgSave Uses

func (c *Ring) BgSave() *StatusCmd

func (*Ring) BitCount Uses

func (c *Ring) BitCount(key string, bitCount *BitCount) *IntCmd

func (*Ring) BitOpAnd Uses

func (c *Ring) BitOpAnd(destKey string, keys ...string) *IntCmd

func (*Ring) BitOpNot Uses

func (c *Ring) BitOpNot(destKey string, key string) *IntCmd

func (*Ring) BitOpOr Uses

func (c *Ring) BitOpOr(destKey string, keys ...string) *IntCmd

func (*Ring) BitOpXor Uses

func (c *Ring) BitOpXor(destKey string, keys ...string) *IntCmd

func (*Ring) BitPos Uses

func (c *Ring) BitPos(key string, bit int64, pos ...int64) *IntCmd

func (*Ring) ClientKill Uses

func (c *Ring) ClientKill(ipPort string) *StatusCmd

func (*Ring) ClientList Uses

func (c *Ring) ClientList() *StringCmd

func (*Ring) ClientPause Uses

func (c *Ring) ClientPause(dur time.Duration) *BoolCmd

func (*Ring) ClientSetName Uses

func (c *Ring) ClientSetName(name string) *BoolCmd

ClientSetName assigns a name to the one of many connections in the pool.

func (*Ring) Close Uses

func (ring *Ring) Close() (retErr error)

Close closes the ring client, releasing any open resources.

It is rare to Close a Ring, as the Ring is meant to be long-lived and shared between many goroutines.

func (*Ring) ClusterAddSlots Uses

func (c *Ring) ClusterAddSlots(slots ...int) *StatusCmd

func (*Ring) ClusterAddSlotsRange Uses

func (c *Ring) ClusterAddSlotsRange(min, max int) *StatusCmd

func (*Ring) ClusterCountFailureReports Uses

func (c *Ring) ClusterCountFailureReports(nodeID string) *IntCmd

func (*Ring) ClusterCountKeysInSlot Uses

func (c *Ring) ClusterCountKeysInSlot(slot int) *IntCmd

func (*Ring) ClusterDelSlots Uses

func (c *Ring) ClusterDelSlots(slots ...int) *StatusCmd

func (*Ring) ClusterDelSlotsRange Uses

func (c *Ring) ClusterDelSlotsRange(min, max int) *StatusCmd

func (*Ring) ClusterFailover Uses

func (c *Ring) ClusterFailover() *StatusCmd

func (*Ring) ClusterForget Uses

func (c *Ring) ClusterForget(nodeID string) *StatusCmd

func (*Ring) ClusterInfo Uses

func (c *Ring) ClusterInfo() *StringCmd

func (*Ring) ClusterKeySlot Uses

func (c *Ring) ClusterKeySlot(key string) *IntCmd

func (*Ring) ClusterMeet Uses

func (c *Ring) ClusterMeet(host, port string) *StatusCmd

func (*Ring) ClusterNodes Uses

func (c *Ring) ClusterNodes() *StringCmd

func (*Ring) ClusterReplicate Uses

func (c *Ring) ClusterReplicate(nodeID string) *StatusCmd

func (*Ring) ClusterResetHard Uses

func (c *Ring) ClusterResetHard() *StatusCmd

func (*Ring) ClusterResetSoft Uses

func (c *Ring) ClusterResetSoft() *StatusCmd

func (*Ring) ClusterSaveConfig Uses

func (c *Ring) ClusterSaveConfig() *StatusCmd

func (*Ring) ClusterSlaves Uses

func (c *Ring) ClusterSlaves(nodeID string) *StringSliceCmd

func (*Ring) ClusterSlots Uses

func (c *Ring) ClusterSlots() *ClusterSlotCmd

func (*Ring) ConfigGet Uses

func (c *Ring) ConfigGet(parameter string) *SliceCmd

func (*Ring) ConfigResetStat Uses

func (c *Ring) ConfigResetStat() *StatusCmd

func (*Ring) ConfigSet Uses

func (c *Ring) ConfigSet(parameter, value string) *StatusCmd

func (*Ring) DbSize Uses

func (c *Ring) DbSize() *IntCmd

func (*Ring) DebugObject Uses

func (c *Ring) DebugObject(key string) *StringCmd

func (*Ring) Decr Uses

func (c *Ring) Decr(key string) *IntCmd

func (*Ring) DecrBy Uses

func (c *Ring) DecrBy(key string, decrement int64) *IntCmd

func (*Ring) Del Uses

func (c *Ring) Del(keys ...string) *IntCmd

func (*Ring) Dump Uses

func (c *Ring) Dump(key string) *StringCmd

func (*Ring) Echo Uses

func (c *Ring) Echo(message string) *StringCmd

func (*Ring) Eval Uses

func (c *Ring) Eval(script string, keys []string, args []string) *Cmd

func (*Ring) EvalSha Uses

func (c *Ring) EvalSha(sha1 string, keys []string, args []string) *Cmd

func (*Ring) Exists Uses

func (c *Ring) Exists(key string) *BoolCmd

func (*Ring) Expire Uses

func (c *Ring) Expire(key string, expiration time.Duration) *BoolCmd

func (*Ring) ExpireAt Uses

func (c *Ring) ExpireAt(key string, tm time.Time) *BoolCmd

func (*Ring) FlushAll Uses

func (c *Ring) FlushAll() *StatusCmd

func (*Ring) FlushDb Uses

func (c *Ring) FlushDb() *StatusCmd

func (*Ring) GeoAdd Uses

func (c *Ring) GeoAdd(key string, geoLocation ...*GeoLocation) *IntCmd

func (*Ring) GeoDist Uses

func (c *Ring) GeoDist(key string, member1, member2, unit string) *FloatCmd

func (*Ring)