Documentation
¶
Overview ¶
Package github.com/vmihailenco/redis implements a Redis client.
Let's start with connecting to Redis using TCP:
password := "" // no password set db := int64(-1) // use default DB client := redis.NewTCPClient("localhost:6379", password, db) defer client.Close() ping := client.Ping() fmt.Println(ping.Err(), ping.Val()) // Output: <nil> PONG
or using Unix socket:
client := redis.NewUnixClient("/tmp/redis.sock", "", -1) defer client.Close() ping := client.Ping() fmt.Println(ping.Err(), ping.Val()) // Output: <nil> PONG
Then we can start sending commands:
set := client.Set("foo", "bar") fmt.Println(set.Err(), set.Val()) get := client.Get("foo") fmt.Println(get.Err(), get.Val()) // Output: <nil> OK // <nil> bar
We can also pipeline two commands together:
var set *redis.StatusReq var get *redis.StringReq reqs, err := client.Pipelined(func(c *redis.PipelineClient) { set = c.Set("key1", "hello1") get = c.Get("key2") }) fmt.Println(err, reqs) fmt.Println(set) fmt.Println(get) // Output: <nil> [SET key1 hello1: OK GET key2: (nil)] // SET key1 hello1: OK // GET key2: (nil)
or:
var set *redis.StatusReq var get *redis.StringReq reqs, err := client.Pipelined(func(c *redis.PipelineClient) { set = c.Set("key1", "hello1") get = c.Get("key2") }) fmt.Println(err, reqs) fmt.Println(set) fmt.Println(get) // Output: <nil> [SET key1 hello1 GET key2] // SET key1 hello1 // GET key2
We can also send several commands in transaction:
func transaction(multi *redis.MultiClient) ([]redis.Req, error) { get := multi.Get("key") if err := get.Err(); err != nil && err != redis.Nil { return nil, err } val, _ := strconv.ParseInt(get.Val(), 10, 64) reqs, err := multi.Exec(func() { multi.Set("key", strconv.FormatInt(val+1, 10)) }) // Transaction failed. Repeat. if err == redis.Nil { return transaction(multi) } return reqs, err } multi, err := client.MultiClient() _ = err defer multi.Close() watch := multi.Watch("key") _ = watch.Err() reqs, err := transaction(multi) fmt.Println(err, reqs) // Output: <nil> [SET key 1: OK]
To subscribe to the channel:
pubsub, err := client.PubSubClient() defer pubsub.Close() ch, err := pubsub.Subscribe("mychannel") _ = err subscribeMsg := <-ch fmt.Println(subscribeMsg.Err, subscribeMsg.Name) pub := client.Publish("mychannel", "hello") _ = pub.Err() msg := <-ch fmt.Println(msg.Err, msg.Message) // Output: <nil> subscribe // <nil> hello
You can also write custom commands:
func Get(client *redis.Client, key string) *redis.StringReq { req := redis.NewStringReq("GET", key) client.Process(req) return req } get := Get(client, "key_does_not_exist") fmt.Println(get.Err(), get.Val()) // Output: (nil)
Client uses connection pool to send commands. You can change maximum number of connections with:
client.ConnPool.(*redis.MultiConnPool).MaxCap = 1
Index ¶
- Variables
- type BitCount
- type BoolReq
- func (r BoolReq) Args() []string
- func (r BoolReq) Err() error
- func (r BoolReq) IfaceVal() interface{}
- func (r *BoolReq) ParseReply(rd reader) (interface{}, error)
- func (r BoolReq) SetErr(err error)
- func (r BoolReq) SetVal(val interface{})
- func (r BoolReq) String() string
- func (r *BoolReq) Val() bool
- type BoolSliceReq
- func (r BoolSliceReq) Args() []string
- func (r BoolSliceReq) Err() error
- func (r BoolSliceReq) IfaceVal() interface{}
- func (r *BoolSliceReq) ParseReply(rd reader) (interface{}, error)
- func (r BoolSliceReq) SetErr(err error)
- func (r BoolSliceReq) SetVal(val interface{})
- func (r BoolSliceReq) String() string
- func (r *BoolSliceReq) Val() []bool
- type Client
- func (c *Client) Append(key, value string) *IntReq
- func (c *Client) Auth(password string) *StatusReq
- func (c *Client) BLPop(timeout int64, keys ...string) *StringSliceReq
- func (c *Client) BRPop(timeout int64, keys ...string) *StringSliceReq
- func (c *Client) BRPopLPush(source, destination string, timeout int64) *StringReq
- func (c *Client) BgRewriteAOF() *StatusReq
- func (c *Client) BgSave() *StatusReq
- func (c *Client) BitCount(key string, bitCount *BitCount) *IntReq
- func (c *Client) BitOpAnd(destKey string, keys ...string) *IntReq
- func (c *Client) BitOpNot(destKey string, key string) *IntReq
- func (c *Client) BitOpOr(destKey string, keys ...string) *IntReq
- func (c *Client) BitOpXor(destKey string, keys ...string) *IntReq
- func (c *Client) ClientKill(ipPort string) *StatusReq
- func (c *Client) ClientList() *StringReq
- func (c Client) Close() error
- func (c *Client) ConfigGet(parameter string) *IfaceSliceReq
- func (c *Client) ConfigResetStat() *StatusReq
- func (c *Client) ConfigSet(parameter, value string) *StatusReq
- func (c *Client) DbSize() *IntReq
- func (c *Client) Decr(key string) *IntReq
- func (c *Client) DecrBy(key string, decrement int64) *IntReq
- func (c *Client) Del(keys ...string) *IntReq
- func (c *Client) Dump(key string) *StringReq
- func (c *Client) Echo(message string) *StringReq
- func (c *Client) Eval(script string, keys []string, args []string) *IfaceReq
- func (c *Client) EvalSha(sha1 string, keys []string, args []string) *IfaceReq
- func (c *Client) Exists(key string) *BoolReq
- func (c *Client) Expire(key string, seconds int64) *BoolReq
- func (c *Client) ExpireAt(key string, timestamp int64) *BoolReq
- func (c *Client) FlushAll() *StatusReq
- func (c *Client) FlushDb() *StatusReq
- func (c *Client) Get(key string) *StringReq
- func (c *Client) GetBit(key string, offset int64) *IntReq
- func (c *Client) GetRange(key string, start, end int64) *StringReq
- func (c *Client) GetSet(key, value string) *StringReq
- func (c *Client) HDel(key string, fields ...string) *IntReq
- func (c *Client) HExists(key, field string) *BoolReq
- func (c *Client) HGet(key, field string) *StringReq
- func (c *Client) HGetAll(key string) *StringSliceReq
- func (c *Client) HGetAllMap(key string) *StringStringMapReq
- func (c *Client) HIncrBy(key, field string, incr int64) *IntReq
- func (c *Client) HIncrByFloat(key, field string, incr float64) *FloatReq
- func (c *Client) HKeys(key string) *StringSliceReq
- func (c *Client) HLen(key string) *IntReq
- func (c *Client) HMGet(key string, fields ...string) *IfaceSliceReq
- func (c *Client) HMSet(key, field, value string, pairs ...string) *StatusReq
- func (c *Client) HSet(key, field, value string) *BoolReq
- func (c *Client) HSetNX(key, field, value string) *BoolReq
- func (c *Client) HVals(key string) *StringSliceReq
- func (c *Client) Incr(key string) *IntReq
- func (c *Client) IncrBy(key string, value int64) *IntReq
- func (c *Client) IncrByFloat(key string, value float64) *FloatReq
- func (c *Client) Info() *StringReq
- func (c *Client) Keys(pattern string) *StringSliceReq
- func (c *Client) LIndex(key string, index int64) *StringReq
- func (c *Client) LInsert(key, op, pivot, value string) *IntReq
- func (c *Client) LLen(key string) *IntReq
- func (c *Client) LPop(key string) *StringReq
- func (c *Client) LPush(key string, values ...string) *IntReq
- func (c *Client) LPushX(key, value string) *IntReq
- func (c *Client) LRange(key string, start, stop int64) *StringSliceReq
- func (c *Client) LRem(key string, count int64, value string) *IntReq
- func (c *Client) LSet(key string, index int64, value string) *StatusReq
- func (c *Client) LTrim(key string, start, stop int64) *StatusReq
- func (c *Client) LastSave() *IntReq
- func (c *Client) MGet(keys ...string) *IfaceSliceReq
- func (c *Client) MSet(pairs ...string) *StatusReq
- func (c *Client) MSetNX(pairs ...string) *BoolReq
- func (c *Client) Migrate(host, port, key string, db, timeout int64) *StatusReq
- func (c *Client) Monitor()
- func (c *Client) Move(key string, db int64) *BoolReq
- func (c *Client) MultiClient() (*MultiClient, error)
- func (c *Client) ObjectEncoding(keys ...string) *StringReq
- func (c *Client) ObjectIdleTime(keys ...string) *IntReq
- func (c *Client) ObjectRefCount(keys ...string) *IntReq
- func (c *Client) PExpire(key string, milliseconds int64) *BoolReq
- func (c *Client) PExpireAt(key string, milliseconds int64) *BoolReq
- func (c *Client) PSetEx(key string, milliseconds int64, value string) *StatusReq
- func (c *Client) PTTL(key string) *IntReq
- func (c *Client) Persist(key string) *BoolReq
- func (c *Client) Ping() *StatusReq
- func (c *Client) PipelineClient() (*PipelineClient, error)
- func (c *Client) Pipelined(do func(*PipelineClient)) ([]Req, error)
- func (c Client) Process(req Req)
- func (c *Client) PubSubClient() (*PubSubClient, error)
- func (c *Client) Publish(channel, message string) *IntReq
- func (c *Client) Quit() *StatusReq
- func (c *Client) RPop(key string) *StringReq
- func (c *Client) RPopLPush(source, destination string) *StringReq
- func (c *Client) RPush(key string, values ...string) *IntReq
- func (c *Client) RPushX(key string, value string) *IntReq
- func (c *Client) RandomKey() *StringReq
- func (c *Client) Rename(key, newkey string) *StatusReq
- func (c *Client) RenameNX(key, newkey string) *BoolReq
- func (c *Client) Restore(key string, ttl int64, value string) *StatusReq
- func (c *Client) SAdd(key string, members ...string) *IntReq
- func (c *Client) SCard(key string) *IntReq
- func (c *Client) SDiff(keys ...string) *StringSliceReq
- func (c *Client) SDiffStore(destination string, keys ...string) *IntReq
- func (c *Client) SInter(keys ...string) *StringSliceReq
- func (c *Client) SInterStore(destination string, keys ...string) *IntReq
- func (c *Client) SIsMember(key, member string) *BoolReq
- func (c *Client) SMembers(key string) *StringSliceReq
- func (c *Client) SMove(source, destination, member string) *BoolReq
- func (c *Client) SPop(key string) *StringReq
- func (c *Client) SRandMember(key string) *StringReq
- func (c *Client) SRem(key string, members ...string) *IntReq
- func (c *Client) SUnion(keys ...string) *StringSliceReq
- func (c *Client) SUnionStore(destination string, keys ...string) *IntReq
- func (c *Client) Save() *StatusReq
- func (c *Client) ScriptExists(scripts ...string) *BoolSliceReq
- func (c *Client) ScriptFlush() *StatusReq
- func (c *Client) ScriptKill() *StatusReq
- func (c *Client) ScriptLoad(script string) *StringReq
- func (c *Client) Select(index int64) *StatusReq
- func (c *Client) Set(key, value string) *StatusReq
- func (c *Client) SetBit(key string, offset int64, value int) *IntReq
- func (c *Client) SetEx(key string, seconds int64, value string) *StatusReq
- func (c *Client) SetNX(key, value string) *BoolReq
- func (c *Client) SetRange(key string, offset int64, value string) *IntReq
- func (c *Client) Shutdown() *StatusReq
- func (c *Client) ShutdownNoSave() *StatusReq
- func (c *Client) ShutdownSave() *StatusReq
- func (c *Client) SlaveOf(host, port string) *StatusReq
- func (c *Client) SlowLog()
- func (c *Client) Sort(key string, sort Sort) *StringSliceReq
- func (c *Client) StrLen(key string) *IntReq
- func (c *Client) Sync()
- func (c *Client) TTL(key string) *IntReq
- func (c *Client) Time() *StringSliceReq
- func (c *Client) Type(key string) *StatusReq
- func (c *Client) ZAdd(key string, members ...Z) *IntReq
- func (c *Client) ZCard(key string) *IntReq
- func (c *Client) ZCount(key, min, max string) *IntReq
- func (c *Client) ZIncrBy(key string, increment float64, member string) *FloatReq
- func (c *Client) ZInterStore(destination string, store ZStore, keys ...string) *IntReq
- func (c *Client) ZRange(key string, start, stop int64) *StringSliceReq
- func (c *Client) ZRangeByScore(key string, min, max string, offset, count int64) *StringSliceReq
- func (c *Client) ZRangeByScoreWithScores(key, min, max string, offset, count int64) *StringSliceReq
- func (c *Client) ZRangeByScoreWithScoresMap(key string, min, max string, offset, count int64) *StringFloatMapReq
- func (c *Client) ZRangeWithScores(key string, start, stop int64) *StringSliceReq
- func (c *Client) ZRangeWithScoresMap(key string, start, stop int64) *StringFloatMapReq
- func (c *Client) ZRank(key, member string) *IntReq
- func (c *Client) ZRem(key string, members ...string) *IntReq
- func (c *Client) ZRemRangeByRank(key string, start, stop int64) *IntReq
- func (c *Client) ZRemRangeByScore(key, min, max string) *IntReq
- func (c *Client) ZRevRange(key, start, stop string) *StringSliceReq
- func (c *Client) ZRevRangeByScore(key, start, stop string, offset, count int64) *StringSliceReq
- func (c *Client) ZRevRangeByScoreWithScores(key, start, stop string, offset, count int64) *StringSliceReq
- func (c *Client) ZRevRangeByScoreWithScoresMap(key, start, stop string, offset, count int64) *StringFloatMapReq
- func (c *Client) ZRevRangeWithScores(key, start, stop string) *StringSliceReq
- func (c *Client) ZRevRangeWithScoresMap(key, start, stop string) *StringFloatMapReq
- func (c *Client) ZRevRank(key, member string) *IntReq
- func (c *Client) ZScore(key, member string) *FloatReq
- func (c *Client) ZUnionStore(destination string, store ZStore, keys ...string) *IntReq
- type ClientFactory
- type FloatReq
- func (r FloatReq) Args() []string
- func (r FloatReq) Err() error
- func (r FloatReq) IfaceVal() interface{}
- func (r *FloatReq) ParseReply(rd reader) (interface{}, error)
- func (r FloatReq) SetErr(err error)
- func (r FloatReq) SetVal(val interface{})
- func (r FloatReq) String() string
- func (r *FloatReq) Val() float64
- type IfaceReq
- func (r IfaceReq) Args() []string
- func (r IfaceReq) Err() error
- func (r IfaceReq) IfaceVal() interface{}
- func (r IfaceReq) ParseReply(rd reader) (interface{}, error)
- func (r IfaceReq) SetErr(err error)
- func (r IfaceReq) SetVal(val interface{})
- func (r IfaceReq) String() string
- func (r *IfaceReq) Val() interface{}
- type IfaceSliceReq
- func (r IfaceSliceReq) Args() []string
- func (r IfaceSliceReq) Err() error
- func (r IfaceSliceReq) IfaceVal() interface{}
- func (r IfaceSliceReq) ParseReply(rd reader) (interface{}, error)
- func (r IfaceSliceReq) SetErr(err error)
- func (r IfaceSliceReq) SetVal(val interface{})
- func (r IfaceSliceReq) String() string
- func (r *IfaceSliceReq) Val() []interface{}
- type IntReq
- type Message
- type MultiClient
- type PipelineClient
- type PubSubClient
- func (c PubSubClient) Close() error
- func (c *PubSubClient) PSubscribe(patterns ...string) (chan *Message, error)
- func (c *PubSubClient) PUnsubscribe(patterns ...string) error
- func (c PubSubClient) Process(req Req)
- func (c *PubSubClient) Subscribe(channels ...string) (chan *Message, error)
- func (c *PubSubClient) Unsubscribe(channels ...string) error
- type Req
- type Script
- func (s *Script) Eval(c *Client, keys []string, args []string) *IfaceReq
- func (s *Script) EvalSha(c *Client, keys []string, args []string) *IfaceReq
- func (s *Script) Exists(c *Client) *BoolSliceReq
- func (s *Script) Load(c *Client) *StringReq
- func (s *Script) Run(c *Client, keys []string, args []string) *IfaceReq
- type Sort
- type StatusReq
- func (r StatusReq) Args() []string
- func (r StatusReq) Err() error
- func (r StatusReq) IfaceVal() interface{}
- func (r StatusReq) ParseReply(rd reader) (interface{}, error)
- func (r StatusReq) SetErr(err error)
- func (r StatusReq) SetVal(val interface{})
- func (r StatusReq) String() string
- func (r *StatusReq) Val() string
- type StringFloatMapReq
- func (r StringFloatMapReq) Args() []string
- func (r StringFloatMapReq) Err() error
- func (r StringFloatMapReq) IfaceVal() interface{}
- func (r *StringFloatMapReq) ParseReply(rd reader) (interface{}, error)
- func (r StringFloatMapReq) SetErr(err error)
- func (r StringFloatMapReq) SetVal(val interface{})
- func (r StringFloatMapReq) String() string
- func (r *StringFloatMapReq) Val() map[string]float64
- type StringReq
- func (r StringReq) Args() []string
- func (r StringReq) Err() error
- func (r StringReq) IfaceVal() interface{}
- func (r StringReq) ParseReply(rd reader) (interface{}, error)
- func (r StringReq) SetErr(err error)
- func (r StringReq) SetVal(val interface{})
- func (r StringReq) String() string
- func (r *StringReq) Val() string
- type StringSliceReq
- func (r StringSliceReq) Args() []string
- func (r StringSliceReq) Err() error
- func (r StringSliceReq) IfaceVal() interface{}
- func (r *StringSliceReq) ParseReply(rd reader) (interface{}, error)
- func (r StringSliceReq) SetErr(err error)
- func (r StringSliceReq) SetVal(val interface{})
- func (r StringSliceReq) String() string
- func (r *StringSliceReq) Val() []string
- type StringStringMapReq
- func (r StringStringMapReq) Args() []string
- func (r StringStringMapReq) Err() error
- func (r StringStringMapReq) IfaceVal() interface{}
- func (r *StringStringMapReq) ParseReply(rd reader) (interface{}, error)
- func (r StringStringMapReq) SetErr(err error)
- func (r StringStringMapReq) SetVal(val interface{})
- func (r StringStringMapReq) String() string
- func (r *StringStringMapReq) Val() map[string]string
- type Z
- type ZStore
Constants ¶
This section is empty.
Variables ¶
Package logger.
View Source
var Nil = errors.New("(nil)")
Represents Redis nil reply.
Functions ¶
This section is empty.
Types ¶
type BoolReq ¶
type BoolReq struct {
// contains filtered or unexported fields
}
func NewBoolReq ¶
func (*BoolReq) ParseReply ¶
type BoolSliceReq ¶
type BoolSliceReq struct {
// contains filtered or unexported fields
}
func NewBoolSliceReq ¶
func NewBoolSliceReq(args ...string) *BoolSliceReq
func (*BoolSliceReq) ParseReply ¶
func (r *BoolSliceReq) ParseReply(rd reader) (interface{}, error)
func (*BoolSliceReq) Val ¶
func (r *BoolSliceReq) Val() []bool
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewTLSClient ¶
func (*Client) BRPopLPush ¶
func (*Client) BgRewriteAOF ¶
func (*Client) ClientKill ¶
func (*Client) ClientList ¶
func (*Client) ConfigGet ¶
func (c *Client) ConfigGet(parameter string) *IfaceSliceReq
func (*Client) ConfigResetStat ¶
func (*Client) HGetAll ¶
func (c *Client) HGetAll(key string) *StringSliceReq
func (*Client) HGetAllMap ¶
func (c *Client) HGetAllMap(key string) *StringStringMapReq
func (*Client) HIncrByFloat ¶
func (*Client) HKeys ¶
func (c *Client) HKeys(key string) *StringSliceReq
func (*Client) HVals ¶
func (c *Client) HVals(key string) *StringSliceReq
func (*Client) Keys ¶
func (c *Client) Keys(pattern string) *StringSliceReq
func (*Client) MGet ¶
func (c *Client) MGet(keys ...string) *IfaceSliceReq
func (*Client) MultiClient ¶
func (c *Client) MultiClient() (*MultiClient, error)
func (*Client) ObjectEncoding ¶
func (*Client) ObjectIdleTime ¶
func (*Client) ObjectRefCount ¶
func (*Client) PipelineClient ¶
func (c *Client) PipelineClient() (*PipelineClient, error)
func (*Client) PubSubClient ¶
func (c *Client) PubSubClient() (*PubSubClient, error)
func (*Client) SDiff ¶
func (c *Client) SDiff(keys ...string) *StringSliceReq
func (*Client) SInter ¶
func (c *Client) SInter(keys ...string) *StringSliceReq
func (*Client) SInterStore ¶
func (*Client) SMembers ¶
func (c *Client) SMembers(key string) *StringSliceReq
func (*Client) SRandMember ¶
func (*Client) SUnion ¶
func (c *Client) SUnion(keys ...string) *StringSliceReq
func (*Client) SUnionStore ¶
func (*Client) ScriptExists ¶
func (c *Client) ScriptExists(scripts ...string) *BoolSliceReq
func (*Client) ScriptFlush ¶
func (*Client) ScriptKill ¶
func (*Client) ScriptLoad ¶
func (*Client) ShutdownNoSave ¶
func (*Client) ShutdownSave ¶
func (*Client) Time ¶
func (c *Client) Time() *StringSliceReq
func (*Client) ZInterStore ¶
func (*Client) ZRangeByScore ¶
func (c *Client) ZRangeByScore(key string, min, max string, offset, count int64) *StringSliceReq
func (*Client) ZRangeByScoreWithScores ¶
func (c *Client) ZRangeByScoreWithScores(key, min, max string, offset, count int64) *StringSliceReq
func (*Client) ZRangeByScoreWithScoresMap ¶
func (c *Client) ZRangeByScoreWithScoresMap( key string, min, max string, offset, count int64) *StringFloatMapReq
func (*Client) ZRangeWithScores ¶
func (c *Client) ZRangeWithScores(key string, start, stop int64) *StringSliceReq
func (*Client) ZRangeWithScoresMap ¶
func (c *Client) ZRangeWithScoresMap(key string, start, stop int64) *StringFloatMapReq
func (*Client) ZRemRangeByRank ¶
func (*Client) ZRemRangeByScore ¶
func (*Client) ZRevRange ¶
func (c *Client) ZRevRange(key, start, stop string) *StringSliceReq
func (*Client) ZRevRangeByScore ¶
func (c *Client) ZRevRangeByScore(key, start, stop string, offset, count int64) *StringSliceReq
func (*Client) ZRevRangeByScoreWithScores ¶
func (c *Client) ZRevRangeByScoreWithScores(key, start, stop string, offset, count int64) *StringSliceReq
func (*Client) ZRevRangeByScoreWithScoresMap ¶
func (c *Client) ZRevRangeByScoreWithScoresMap( key, start, stop string, offset, count int64) *StringFloatMapReq
func (*Client) ZRevRangeWithScores ¶
func (c *Client) ZRevRangeWithScores(key, start, stop string) *StringSliceReq
func (*Client) ZRevRangeWithScoresMap ¶
func (c *Client) ZRevRangeWithScoresMap(key, start, stop string) *StringFloatMapReq
type ClientFactory ¶
type ClientFactory struct { Dial func() (net.Conn, error) Close func(net.Conn) error Password string DB int64 PoolSize int ReadTimeout, WriteTimeout, IdleTimeout time.Duration }
func (*ClientFactory) New ¶
func (f *ClientFactory) New() *Client
type FloatReq ¶
type FloatReq struct {
// contains filtered or unexported fields
}
func NewFloatReq ¶
func (*FloatReq) ParseReply ¶
type IfaceReq ¶
type IfaceReq struct {
// contains filtered or unexported fields
}
func NewIfaceReq ¶
func (IfaceReq) ParseReply ¶
func (r IfaceReq) ParseReply(rd reader) (interface{}, error)
type IfaceSliceReq ¶
type IfaceSliceReq struct {
// contains filtered or unexported fields
}
func NewIfaceSliceReq ¶
func NewIfaceSliceReq(args ...string) *IfaceSliceReq
func (IfaceSliceReq) ParseReply ¶
func (r IfaceSliceReq) ParseReply(rd reader) (interface{}, error)
func (*IfaceSliceReq) Val ¶
func (r *IfaceSliceReq) Val() []interface{}
type IntReq ¶
type IntReq struct {
// contains filtered or unexported fields
}
func (IntReq) ParseReply ¶
func (r IntReq) ParseReply(rd reader) (interface{}, error)
type MultiClient ¶
type MultiClient struct { *Client // contains filtered or unexported fields }
func (*MultiClient) Close ¶
func (c *MultiClient) Close() error
func (*MultiClient) Discard ¶
func (c *MultiClient) Discard()
func (*MultiClient) Exec ¶
func (c *MultiClient) Exec(do func()) ([]Req, error)
func (*MultiClient) Unwatch ¶
func (c *MultiClient) Unwatch(keys ...string) *StatusReq
func (*MultiClient) Watch ¶
func (c *MultiClient) Watch(keys ...string) *StatusReq
type PipelineClient ¶
type PipelineClient struct {
*Client
}
func (*PipelineClient) Close ¶
func (c *PipelineClient) Close() error
func (*PipelineClient) DiscardQueued ¶
func (c *PipelineClient) DiscardQueued()
func (*PipelineClient) RunQueued ¶
func (c *PipelineClient) RunQueued() ([]Req, error)
type PubSubClient ¶
type PubSubClient struct {
// contains filtered or unexported fields
}
func (*PubSubClient) PSubscribe ¶
func (c *PubSubClient) PSubscribe(patterns ...string) (chan *Message, error)
func (*PubSubClient) PUnsubscribe ¶
func (c *PubSubClient) PUnsubscribe(patterns ...string) error
func (*PubSubClient) Subscribe ¶
func (c *PubSubClient) Subscribe(channels ...string) (chan *Message, error)
func (*PubSubClient) Unsubscribe ¶
func (c *PubSubClient) Unsubscribe(channels ...string) error
type Script ¶
type Script struct {
// contains filtered or unexported fields
}
func (*Script) Exists ¶
func (s *Script) Exists(c *Client) *BoolSliceReq
type StatusReq ¶
type StatusReq struct {
// contains filtered or unexported fields
}
func NewStatusReq ¶
func (StatusReq) ParseReply ¶
func (r StatusReq) ParseReply(rd reader) (interface{}, error)
type StringFloatMapReq ¶
type StringFloatMapReq struct {
// contains filtered or unexported fields
}
func NewStringFloatMapReq ¶
func NewStringFloatMapReq(args ...string) *StringFloatMapReq
func (*StringFloatMapReq) ParseReply ¶
func (r *StringFloatMapReq) ParseReply(rd reader) (interface{}, error)
func (*StringFloatMapReq) Val ¶
func (r *StringFloatMapReq) Val() map[string]float64
type StringReq ¶
type StringReq struct {
// contains filtered or unexported fields
}
func NewStringReq ¶
func (StringReq) ParseReply ¶
func (r StringReq) ParseReply(rd reader) (interface{}, error)
type StringSliceReq ¶
type StringSliceReq struct {
// contains filtered or unexported fields
}
func NewStringSliceReq ¶
func NewStringSliceReq(args ...string) *StringSliceReq
func (*StringSliceReq) ParseReply ¶
func (r *StringSliceReq) ParseReply(rd reader) (interface{}, error)
func (*StringSliceReq) Val ¶
func (r *StringSliceReq) Val() []string
type StringStringMapReq ¶
type StringStringMapReq struct {
// contains filtered or unexported fields
}
func NewStringStringMapReq ¶
func NewStringStringMapReq(args ...string) *StringStringMapReq
func (*StringStringMapReq) ParseReply ¶
func (r *StringStringMapReq) ParseReply(rd reader) (interface{}, error)
func (*StringStringMapReq) Val ¶
func (r *StringStringMapReq) Val() map[string]string
Click to show internal directories.
Click to hide internal directories.