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

Add FlushDBAsync and FlushAllAsync

This commit is contained in:
Vladimir Mihailenco
2017-06-17 12:53:16 +03:00
parent 167410bcd7
commit f1ed2ad288
15 changed files with 43 additions and 22 deletions

View File

@ -192,7 +192,9 @@ type Cmdable interface {
ConfigSet(parameter, value string) *StatusCmd
DbSize() *IntCmd
FlushAll() *StatusCmd
FlushDb() *StatusCmd
FlushAllAsync() *StatusCmd
FlushDB() *StatusCmd
FlushDBAsync() *StatusCmd
Info(section ...string) *StringCmd
LastSave() *IntCmd
Save() *StatusCmd
@ -1685,12 +1687,31 @@ func (c *cmdable) FlushAll() *StatusCmd {
return cmd
}
func (c *cmdable) FlushAllAsync() *StatusCmd {
cmd := NewStatusCmd("flushall", "async")
c.process(cmd)
return cmd
}
// Deprecated. Use FlushDB instead.
func (c *cmdable) FlushDb() *StatusCmd {
cmd := NewStatusCmd("flushdb")
c.process(cmd)
return cmd
}
func (c *cmdable) FlushDB() *StatusCmd {
cmd := NewStatusCmd("flushdb")
c.process(cmd)
return cmd
}
func (c *cmdable) FlushDBAsync() *StatusCmd {
cmd := NewStatusCmd("flushdb", "async")
c.process(cmd)
return cmd
}
func (c *cmdable) Info(section ...string) *StringCmd {
args := []interface{}{"info"}
if len(section) > 0 {