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

Add SHUTDOWN command.

This commit is contained in:
Vladimir Mihailenco
2012-08-25 15:35:39 +03:00
parent b6ae953e1c
commit e40a6041e1
2 changed files with 55 additions and 11 deletions

View File

@ -1006,8 +1006,29 @@ func (c *Client) Save() *StatusReq {
return req
}
func (c *Client) Shutdown() {
panic("not implemented")
func (c *Client) shutdown(modifier string) *StatusReq {
var args []string
if modifier == "" {
args = []string{"SHUTDOWN"}
} else {
args = []string{"SHUTDOWN", modifier}
}
req := NewStatusReq(args...)
c.Process(req)
c.Close()
return req
}
func (c *Client) Shutdown() *StatusReq {
return c.shutdown("")
}
func (c *Client) ShutdownSave() *StatusReq {
return c.shutdown("SAVE")
}
func (c *Client) ShutdownNoSave() *StatusReq {
return c.shutdown("NOSAVE")
}
func (c *Client) SlaveOf(host, port string) *StatusReq {