Skip to content

Commit

Permalink
Merge pull request #344 from go-redis/fix/rename-commander
Browse files Browse the repository at this point in the history
Rename Commander to Cmdable to match internal name.
  • Loading branch information
vmihailenco authored Jul 21, 2016
2 parents 46240a2 + ff8419f commit bc66ed0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ func formatSec(dur time.Duration) string {
return strconv.FormatInt(int64(dur/time.Second), 10)
}

type cmdable struct {
process func(cmd Cmder) error
}

type Commander interface {
type Cmdable interface {
Echo(message interface{}) *StringCmd
Ping() *StatusCmd
Quit() *StatusCmd
Expand Down Expand Up @@ -208,8 +204,6 @@ type Commander interface {
ShutdownSave() *StatusCmd
ShutdownNoSave() *StatusCmd
SlaveOf(host, port string) *StatusCmd
SlowLog()
Sync()
Time() *StringSliceCmd
Eval(script string, keys []string, args ...interface{}) *Cmd
EvalSha(sha1 string, keys []string, args ...interface{}) *Cmd
Expand Down Expand Up @@ -247,6 +241,12 @@ type Commander interface {
Command() *CommandsInfoCmd
}

type cmdable struct {
process func(cmd Cmder) error
}

var _ Cmdable = (*cmdable)(nil)

type statefulCmdable struct {
process func(cmd Cmder) error
}
Expand Down Expand Up @@ -1739,6 +1739,7 @@ func (c *cmdable) Sync() {
panic("not implemented")
}

// TODO: add TimeCmd and use it here
func (c *cmdable) Time() *StringSliceCmd {
cmd := NewStringSliceCmd("time")
c.process(cmd)
Expand Down

0 comments on commit bc66ed0

Please sign in to comment.