1
0
mirror of https://github.com/redis/go-redis.git synced 2025-06-16 23:40:55 +03:00

Allow setting and scaning interface{} values.

This commit is contained in:
Vladimir Mihailenco
2015-05-28 15:51:19 +03:00
parent 90888881b4
commit 3c1f2bd45a
10 changed files with 726 additions and 230 deletions

View File

@ -44,14 +44,22 @@ func (c *Multi) Close() error {
}
func (c *Multi) Watch(keys ...string) *StatusCmd {
args := append([]string{"WATCH"}, keys...)
args := make([]interface{}, 1+len(keys))
args[0] = "WATCH"
for i, key := range keys {
args[1+i] = key
}
cmd := NewStatusCmd(args...)
c.Process(cmd)
return cmd
}
func (c *Multi) Unwatch(keys ...string) *StatusCmd {
args := append([]string{"UNWATCH"}, keys...)
args := make([]interface{}, 1+len(keys))
args[0] = "UNWATCH"
for i, key := range keys {
args[1+i] = key
}
cmd := NewStatusCmd(args...)
c.Process(cmd)
return cmd