mirror of
https://github.com/redis/go-redis.git
synced 2025-06-12 14:21:52 +03:00
add support for SPOP with a count argument (available in REDIS 3.2)
This commit is contained in:
committed by
Vladimir Mihailenco
parent
8964a568f3
commit
cd582ed576
@ -946,12 +946,20 @@ func (c cmdable) SMove(source, destination string, member interface{}) *BoolCmd
|
||||
return cmd
|
||||
}
|
||||
|
||||
// Redis `SPOP key` command.
|
||||
func (c cmdable) SPop(key string) *StringCmd {
|
||||
cmd := NewStringCmd("spop", key)
|
||||
c.process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
// Redis `SPOP key count` command.
|
||||
func (c cmdable) SPopN(key string, count int64) *StringSliceCmd {
|
||||
cmd := NewStringSliceCmd("spop", key, count)
|
||||
c.process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
// Redis `SRANDMEMBER key` command.
|
||||
func (c cmdable) SRandMember(key string) *StringCmd {
|
||||
cmd := NewStringCmd("srandmember", key)
|
||||
|
Reference in New Issue
Block a user