mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Supports new style syntax of client kill command
This commit is contained in:
15
commands.go
15
commands.go
@ -220,6 +220,7 @@ type Cmdable interface {
|
||||
BgRewriteAOF() *StatusCmd
|
||||
BgSave() *StatusCmd
|
||||
ClientKill(ipPort string) *StatusCmd
|
||||
ClientKillByFilter(keys ...string) *IntCmd
|
||||
ClientList() *StringCmd
|
||||
ClientPause(dur time.Duration) *BoolCmd
|
||||
ConfigGet(parameter string) *SliceCmd
|
||||
@ -1822,6 +1823,20 @@ func (c *cmdable) ClientKill(ipPort string) *StatusCmd {
|
||||
return cmd
|
||||
}
|
||||
|
||||
// ClientKillByFilter is new style synx, while the ClientKill is old
|
||||
// CLIENT KILL <option> [value] ... <option> [value]
|
||||
func (c *cmdable) ClientKillByFilter(keys ...string) *IntCmd {
|
||||
args := make([]interface{}, 2+len(keys))
|
||||
args[0] = "client"
|
||||
args[1] = "kill"
|
||||
for i, key := range keys {
|
||||
args[2+i] = key
|
||||
}
|
||||
cmd := NewIntCmd(args...)
|
||||
c.process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *cmdable) ClientList() *StringCmd {
|
||||
cmd := NewStringCmd("client", "list")
|
||||
c.process(cmd)
|
||||
|
Reference in New Issue
Block a user