@@ -130,6 +130,14 @@ func (c *SentinelClient) pubSub() *PubSub {
130
130
return pubsub
131
131
}
132
132
133
+ // Ping is used to test if a connection is still alive, or to
134
+ // measure latency.
135
+ func (c * SentinelClient ) Ping () * StringCmd {
136
+ cmd := NewStringCmd ("ping" )
137
+ c .Process (cmd )
138
+ return cmd
139
+ }
140
+
133
141
// Subscribe subscribes the client to the specified channels.
134
142
// Channels can be omitted to create empty subscription.
135
143
func (c * SentinelClient ) Subscribe (channels ... string ) * PubSub {
@@ -219,6 +227,30 @@ func (c *SentinelClient) CkQuorum(name string) *StringCmd {
219
227
return cmd
220
228
}
221
229
230
+ // Monitor tells the Sentinel to start monitoring a new master with the specified
231
+ // name, ip, port, and quorum.
232
+ func (c * SentinelClient ) Monitor (name , ip , port , quorum string ) * StringCmd {
233
+ cmd := NewStringCmd ("sentinel" , "monitor" , name , ip , port , quorum )
234
+ c .Process (cmd )
235
+ return cmd
236
+ }
237
+
238
+ // Set is used in order to change configuration parameters of a specific master.
239
+ func (c * SentinelClient ) Set (name , option , value string ) * StringCmd {
240
+ cmd := NewStringCmd ("sentinel" , "set" , name , option , value )
241
+ c .Process (cmd )
242
+ return cmd
243
+ }
244
+
245
+ // Remove is used in order to remove the specified master: the master will no
246
+ // longer be monitored, and will totally be removed from the internal state of
247
+ // the Sentinel.
248
+ func (c * SentinelClient ) Remove (name string ) * StringCmd {
249
+ cmd := NewStringCmd ("sentinel" , "remove" , name )
250
+ c .Process (cmd )
251
+ return cmd
252
+ }
253
+
222
254
type sentinelFailover struct {
223
255
sentinelAddrs []string
224
256
0 commit comments