From 3c02e56ed99705bfe0d591806289e0a68988390e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Michon?= Date: Thu, 21 Feb 2019 11:28:23 +0100 Subject: [PATCH 1/2] Add the flushconfig sentinel command --- sentinel.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sentinel.go b/sentinel.go index 7cbb90bd..09ca98f0 100644 --- a/sentinel.go +++ b/sentinel.go @@ -182,6 +182,14 @@ func (c *SentinelClient) Reset(pattern string) *IntCmd { return cmd } +// FlushConfig forces Sentinel to rewrite its configuration on disk, including +// the current Sentinel state. +func (c *SentinelClient) FlushConfig() *StatusCmd { + cmd := NewStatusCmd("sentinel", "flushconfig") + c.Process(cmd) + return cmd +} + type sentinelFailover struct { sentinelAddrs []string From c340532290e53480b8159fa88dfdd62f760a7ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Michon?= Date: Thu, 21 Feb 2019 18:13:04 +0100 Subject: [PATCH 2/2] Add the master sentinel command --- sentinel.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sentinel.go b/sentinel.go index 09ca98f0..691d1719 100644 --- a/sentinel.go +++ b/sentinel.go @@ -190,6 +190,13 @@ func (c *SentinelClient) FlushConfig() *StatusCmd { return cmd } +// Master shows the state and info of the specified master. +func (c *SentinelClient) Master(name string) *StringStringMapCmd { + cmd := NewStringStringMapCmd("sentinel", "master", name) + c.Process(cmd) + return cmd +} + type sentinelFailover struct { sentinelAddrs []string