mirror of
https://github.com/redis/go-redis.git
synced 2025-06-12 14:21:52 +03:00
Implement SetName and GetName
Allows setting and getting the client connection name. http://redis.io/commands/client-setname http://redis.io/commands/client-getname
This commit is contained in:
12
commands.go
12
commands.go
@ -1367,6 +1367,18 @@ func (c *commandable) ClientPause(dur time.Duration) *BoolCmd {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *commandable) SetName(name string) *StatusCmd {
|
||||
cmd := NewStatusCmd("CLIENT", "SETNAME", name)
|
||||
c.Process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *Client) GetName() *StringCmd {
|
||||
cmd := NewStringCmd("CLIENT", "GETNAME")
|
||||
c.Process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *commandable) ConfigGet(parameter string) *SliceCmd {
|
||||
cmd := NewSliceCmd("CONFIG", "GET", parameter)
|
||||
cmd._clusterKeyPos = 0
|
||||
|
Reference in New Issue
Block a user