forked from mirror/redis
Add Pipeline to Cmdable.
This commit is contained in:
parent
1c402b7989
commit
0b706418d9
|
@ -39,6 +39,8 @@ type ClusterClient struct {
|
||||||
reloading uint32
|
reloading uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _ Cmdable = (*ClusterClient)(nil)
|
||||||
|
|
||||||
// NewClusterClient returns a Redis Cluster client as described in
|
// NewClusterClient returns a Redis Cluster client as described in
|
||||||
// http://redis.io/topics/cluster-spec.
|
// http://redis.io/topics/cluster-spec.
|
||||||
func NewClusterClient(opt *ClusterOptions) *ClusterClient {
|
func NewClusterClient(opt *ClusterOptions) *ClusterClient {
|
||||||
|
|
|
@ -41,6 +41,9 @@ func formatSec(dur time.Duration) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Cmdable interface {
|
type Cmdable interface {
|
||||||
|
Pipeline() *Pipeline
|
||||||
|
Pipelined(fn func(*Pipeline) error) ([]Cmder, error)
|
||||||
|
|
||||||
Echo(message interface{}) *StringCmd
|
Echo(message interface{}) *StringCmd
|
||||||
Ping() *StatusCmd
|
Ping() *StatusCmd
|
||||||
Quit() *StatusCmd
|
Quit() *StatusCmd
|
||||||
|
@ -247,8 +250,6 @@ func (c *cmdable) WrapProcess(createWrapper func(oldProcess func(cmd Cmder) erro
|
||||||
c.process = createWrapper(c.process)
|
c.process = createWrapper(c.process)
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ Cmdable = (*cmdable)(nil)
|
|
||||||
|
|
||||||
type statefulCmdable struct {
|
type statefulCmdable struct {
|
||||||
process func(cmd Cmder) error
|
process func(cmd Cmder) error
|
||||||
}
|
}
|
||||||
|
|
2
redis.go
2
redis.go
|
@ -150,6 +150,8 @@ type Client struct {
|
||||||
cmdable
|
cmdable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _ Cmdable = (*Client)(nil)
|
||||||
|
|
||||||
func newClient(opt *Options, pool pool.Pooler) *Client {
|
func newClient(opt *Options, pool pool.Pooler) *Client {
|
||||||
base := baseClient{opt: opt, connPool: pool}
|
base := baseClient{opt: opt, connPool: pool}
|
||||||
client := &Client{
|
client := &Client{
|
||||||
|
|
Loading…
Reference in New Issue