forked from mirror/redis
Impement Config Rewrite command (#722)
This commit adds support for config rewrite as documented in https://redis.io/commands/config-rewrite .
This commit is contained in:
parent
55c9929dba
commit
d0a2b8bdf3
|
@ -198,6 +198,7 @@ type Cmdable interface {
|
||||||
ConfigGet(parameter string) *SliceCmd
|
ConfigGet(parameter string) *SliceCmd
|
||||||
ConfigResetStat() *StatusCmd
|
ConfigResetStat() *StatusCmd
|
||||||
ConfigSet(parameter, value string) *StatusCmd
|
ConfigSet(parameter, value string) *StatusCmd
|
||||||
|
ConfigRewrite() *StatusCmd
|
||||||
DBSize() *IntCmd
|
DBSize() *IntCmd
|
||||||
FlushAll() *StatusCmd
|
FlushAll() *StatusCmd
|
||||||
FlushAllAsync() *StatusCmd
|
FlushAllAsync() *StatusCmd
|
||||||
|
@ -1725,6 +1726,12 @@ func (c *cmdable) ConfigSet(parameter, value string) *StatusCmd {
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *cmdable) ConfigRewrite() *StatusCmd {
|
||||||
|
cmd := NewStatusCmd("config", "rewrite")
|
||||||
|
c.process(cmd)
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
// Deperecated. Use DBSize instead.
|
// Deperecated. Use DBSize instead.
|
||||||
func (c *cmdable) DbSize() *IntCmd {
|
func (c *cmdable) DbSize() *IntCmd {
|
||||||
return c.DBSize()
|
return c.DBSize()
|
||||||
|
|
|
@ -162,6 +162,12 @@ var _ = Describe("Commands", func() {
|
||||||
Expect(configSet.Val()).To(Equal("OK"))
|
Expect(configSet.Val()).To(Equal("OK"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("should ConfigRewrite", func() {
|
||||||
|
configRewrite := client.ConfigRewrite()
|
||||||
|
Expect(configRewrite.Err()).NotTo(HaveOccurred())
|
||||||
|
Expect(configRewrite.Val()).To(Equal("OK"))
|
||||||
|
})
|
||||||
|
|
||||||
It("should DBSize", func() {
|
It("should DBSize", func() {
|
||||||
size, err := client.DBSize().Result()
|
size, err := client.DBSize().Result()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
|
|
Loading…
Reference in New Issue