1
0
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:
Vladimir Mihailenco
2016-12-22 13:42:05 +02:00
parent 754e4ed906
commit 0f05d8df9d
2 changed files with 30 additions and 9 deletions

View File

@ -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)