mirror of https://github.com/go-redis/redis.git
Merge pull request #344 from go-redis/fix/rename-commander
Rename Commander to Cmdable to match internal name.
This commit is contained in:
commit
bc66ed0eba
15
commands.go
15
commands.go
|
@ -40,11 +40,7 @@ func formatSec(dur time.Duration) string {
|
||||||
return strconv.FormatInt(int64(dur/time.Second), 10)
|
return strconv.FormatInt(int64(dur/time.Second), 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
type cmdable struct {
|
type Cmdable interface {
|
||||||
process func(cmd Cmder) error
|
|
||||||
}
|
|
||||||
|
|
||||||
type Commander interface {
|
|
||||||
Echo(message interface{}) *StringCmd
|
Echo(message interface{}) *StringCmd
|
||||||
Ping() *StatusCmd
|
Ping() *StatusCmd
|
||||||
Quit() *StatusCmd
|
Quit() *StatusCmd
|
||||||
|
@ -208,8 +204,6 @@ type Commander interface {
|
||||||
ShutdownSave() *StatusCmd
|
ShutdownSave() *StatusCmd
|
||||||
ShutdownNoSave() *StatusCmd
|
ShutdownNoSave() *StatusCmd
|
||||||
SlaveOf(host, port string) *StatusCmd
|
SlaveOf(host, port string) *StatusCmd
|
||||||
SlowLog()
|
|
||||||
Sync()
|
|
||||||
Time() *StringSliceCmd
|
Time() *StringSliceCmd
|
||||||
Eval(script string, keys []string, args ...interface{}) *Cmd
|
Eval(script string, keys []string, args ...interface{}) *Cmd
|
||||||
EvalSha(sha1 string, keys []string, args ...interface{}) *Cmd
|
EvalSha(sha1 string, keys []string, args ...interface{}) *Cmd
|
||||||
|
@ -247,6 +241,12 @@ type Commander interface {
|
||||||
Command() *CommandsInfoCmd
|
Command() *CommandsInfoCmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type cmdable struct {
|
||||||
|
process func(cmd Cmder) error
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ Cmdable = (*cmdable)(nil)
|
||||||
|
|
||||||
type statefulCmdable struct {
|
type statefulCmdable struct {
|
||||||
process func(cmd Cmder) error
|
process func(cmd Cmder) error
|
||||||
}
|
}
|
||||||
|
@ -1739,6 +1739,7 @@ func (c *cmdable) Sync() {
|
||||||
panic("not implemented")
|
panic("not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: add TimeCmd and use it here
|
||||||
func (c *cmdable) Time() *StringSliceCmd {
|
func (c *cmdable) Time() *StringSliceCmd {
|
||||||
cmd := NewStringSliceCmd("time")
|
cmd := NewStringSliceCmd("time")
|
||||||
c.process(cmd)
|
c.process(cmd)
|
||||||
|
|
Loading…
Reference in New Issue