mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Add unlink command.
This commit is contained in:
12
commands.go
12
commands.go
@ -47,6 +47,7 @@ type Cmdable interface {
|
||||
Ping() *StatusCmd
|
||||
Quit() *StatusCmd
|
||||
Del(keys ...string) *IntCmd
|
||||
Unlink(keys ...string) *IntCmd
|
||||
Dump(key string) *StringCmd
|
||||
Exists(key string) *BoolCmd
|
||||
Expire(key string, expiration time.Duration) *BoolCmd
|
||||
@ -292,6 +293,17 @@ func (c *cmdable) Del(keys ...string) *IntCmd {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *cmdable) Unlink(keys ...string) *IntCmd {
|
||||
args := make([]interface{}, 1+len(keys))
|
||||
args[0] = "unlink"
|
||||
for i, key := range keys {
|
||||
args[1+i] = key
|
||||
}
|
||||
cmd := NewIntCmd(args...)
|
||||
c.process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *cmdable) Dump(key string) *StringCmd {
|
||||
cmd := NewStringCmd("dump", key)
|
||||
c.process(cmd)
|
||||
|
Reference in New Issue
Block a user