1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Add pubsub* commands.

This commit is contained in:
Vladimir Mihailenco
2014-10-07 13:06:41 +03:00
parent 7aeeecb761
commit a11f80d9d7
2 changed files with 68 additions and 0 deletions

View File

@ -1208,3 +1208,25 @@ func (c *Client) DebugObject(key string) *StringCmd {
c.Process(cmd)
return cmd
}
//------------------------------------------------------------------------------
func (c *Client) PubSubChannels(pattern string) *StringSliceCmd {
cmd := NewStringSliceCmd("PUBSUB", "CHANNELS", pattern)
c.Process(cmd)
return cmd
}
func (c *Client) PubSubNumSub(channels ...string) *StringSliceCmd {
args := []string{"PUBSUB", "NUMSUB"}
args = append(args, channels...)
cmd := NewStringSliceCmd(args...)
c.Process(cmd)
return cmd
}
func (c *Client) PubSubNumPat() *IntCmd {
cmd := NewIntCmd("PUBSUB", "NUMPAT")
c.Process(cmd)
return cmd
}