mirror of https://github.com/go-redis/redis.git
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
|
||||
ConfigResetStat() *StatusCmd
|
||||
ConfigSet(parameter, value string) *StatusCmd
|
||||
ConfigRewrite() *StatusCmd
|
||||
DBSize() *IntCmd
|
||||
FlushAll() *StatusCmd
|
||||
FlushAllAsync() *StatusCmd
|
||||
|
@ -1725,6 +1726,12 @@ func (c *cmdable) ConfigSet(parameter, value string) *StatusCmd {
|
|||
return cmd
|
||||
}
|
||||
|
||||
func (c *cmdable) ConfigRewrite() *StatusCmd {
|
||||
cmd := NewStatusCmd("config", "rewrite")
|
||||
c.process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
// Deperecated. Use DBSize instead.
|
||||
func (c *cmdable) DbSize() *IntCmd {
|
||||
return c.DBSize()
|
||||
|
|
|
@ -162,6 +162,12 @@ var _ = Describe("Commands", func() {
|
|||
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() {
|
||||
size, err := client.DBSize().Result()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
|
Loading…
Reference in New Issue