Trait fred::interfaces::SentinelInterface

source ·
pub trait SentinelInterface: ClientLike + Sized {
Show 18 methods // Provided methods fn ckquorum<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>> where R: FromRedis, N: Into<Str> { ... } fn flushconfig<R>(&self) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn failover<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>> where R: FromRedis, N: Into<Str> { ... } fn get_master_addr_by_name<R, N>( &self, name: N, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, N: Into<Str> { ... } fn info_cache<R>(&self) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn master<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>> where R: FromRedis, N: Into<Str> { ... } fn masters<R>(&self) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn monitor<R, N>( &self, name: N, ip: IpAddr, port: u16, quorum: u32, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, N: Into<Str> { ... } fn myid<R>(&self) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn pending_scripts<R>(&self) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn remove<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>> where R: FromRedis, N: Into<Str> { ... } fn replicas<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>> where R: FromRedis, N: Into<Str> { ... } fn sentinels<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>> where R: FromRedis, N: Into<Str> { ... } fn set<R, N, V>( &self, name: N, args: V, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, N: Into<Str>, V: TryInto<RedisMap>, V::Error: Into<RedisError> { ... } fn simulate_failure<R>( &self, kind: SentinelFailureKind, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn reset<R, P>(&self, pattern: P) -> impl Future<Output = RedisResult<R>> where R: FromRedis, P: Into<Str> { ... } fn config_get<R, K>(&self, name: K) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<Str> { ... } fn config_set<R, K, V>( &self, name: K, value: V, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<Str>, V: TryInto<RedisValue>, V::Error: Into<RedisError> { ... }
}
Available on crate feature sentinel-client only.
Expand description

Functions that implement the sentinel interface.

Provided Methods§

source

fn ckquorum<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, N: Into<Str>,

Check if the current Sentinel configuration is able to reach the quorum needed to failover a master, and the majority needed to authorize the failover.

source

fn flushconfig<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Force Sentinel to rewrite its configuration on disk, including the current Sentinel state.

source

fn failover<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, N: Into<Str>,

Force a failover as if the master was not reachable, and without asking for agreement to other Sentinels.

source

fn get_master_addr_by_name<R, N>( &self, name: N, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, N: Into<Str>,

Return the ip and port number of the master with that name.

source

fn info_cache<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Return cached INFO output from masters and replicas.

source

fn master<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, N: Into<Str>,

Show the state and info of the specified master.

source

fn masters<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Show a list of monitored masters and their state.

source

fn monitor<R, N>( &self, name: N, ip: IpAddr, port: u16, quorum: u32, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, N: Into<Str>,

source

fn myid<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Return the ID of the Sentinel instance.

source

fn pending_scripts<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

This command returns information about pending scripts.

source

fn remove<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, N: Into<Str>,

source

fn replicas<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, N: Into<Str>,

Show a list of replicas for this master, and their state.

source

fn sentinels<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, N: Into<Str>,

Show a list of sentinel instances for this master, and their state.

source

fn set<R, N, V>(&self, name: N, args: V) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, N: Into<Str>, V: TryInto<RedisMap>, V::Error: Into<RedisError>,

Set Sentinel’s monitoring configuration.

https://redis.io/topics/sentinel#reconfiguring-sentinel-at-runtime

source

fn simulate_failure<R>( &self, kind: SentinelFailureKind, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

This command simulates different Sentinel crash scenarios.

source

fn reset<R, P>(&self, pattern: P) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, P: Into<Str>,

This command will reset all the masters with matching name.

source

fn config_get<R, K>(&self, name: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<Str>,

Get the current value of a global Sentinel configuration parameter. The specified name may be a wildcard, similar to the Redis CONFIG GET command.

source

fn config_set<R, K, V>( &self, name: K, value: V, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<Str>, V: TryInto<RedisValue>, V::Error: Into<RedisError>,

Set the value of a global Sentinel configuration parameter.

Object Safety§

This trait is not object safe.

Implementors§