pub struct RedisClusterTemplate { /* private fields */ }
Expand description
Redis Cluster template for automatic multi-node cluster setup
Implementations§
Source§impl RedisClusterTemplate
impl RedisClusterTemplate
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Create a new Redis Cluster template with default settings
Sourcepub fn num_masters(self, masters: usize) -> Self
pub fn num_masters(self, masters: usize) -> Self
Set the number of master nodes (minimum 3)
Sourcepub fn num_replicas(self, replicas: usize) -> Self
pub fn num_replicas(self, replicas: usize) -> Self
Set the number of replicas per master
Sourcepub fn cluster_announce_ip(self, ip: impl Into<String>) -> Self
pub fn cluster_announce_ip(self, ip: impl Into<String>) -> Self
Set the IP to announce to other cluster nodes
Sourcepub fn with_persistence(self, volume_prefix: impl Into<String>) -> Self
pub fn with_persistence(self, volume_prefix: impl Into<String>) -> Self
Enable persistence with volume prefix
Sourcepub fn memory_limit(self, limit: impl Into<String>) -> Self
pub fn memory_limit(self, limit: impl Into<String>) -> Self
Set memory limit per node
Sourcepub fn cluster_node_timeout(self, timeout: u32) -> Self
pub fn cluster_node_timeout(self, timeout: u32) -> Self
Set cluster node timeout in milliseconds
Sourcepub fn auto_remove(self) -> Self
pub fn auto_remove(self) -> Self
Enable auto-remove when stopped
Sourcepub fn with_redis_stack(self) -> Self
pub fn with_redis_stack(self) -> Self
Use Redis Stack instead of standard Redis (includes modules like JSON, Search, Graph, TimeSeries, Bloom)
Sourcepub fn with_redis_insight(self) -> Self
pub fn with_redis_insight(self) -> Self
Enable RedisInsight GUI for cluster visualization and management
Sourcepub fn redis_insight_port(self, port: u16) -> Self
pub fn redis_insight_port(self, port: u16) -> Self
Set the port for RedisInsight UI (default: 8001)
Sourcepub fn custom_redis_image(
self,
image: impl Into<String>,
tag: impl Into<String>,
) -> Self
pub fn custom_redis_image( self, image: impl Into<String>, tag: impl Into<String>, ) -> Self
Use a custom Redis image and tag
Sourcepub fn platform(self, platform: impl Into<String>) -> Self
pub fn platform(self, platform: impl Into<String>) -> Self
Set the platform for the containers (e.g., “linux/arm64”, “linux/amd64”)
Sourcepub async fn cluster_info(&self) -> Result<ClusterInfo, TemplateError>
pub async fn cluster_info(&self) -> Result<ClusterInfo, TemplateError>
Check cluster status
Trait Implementations§
Source§impl Template for RedisClusterTemplate
impl Template for RedisClusterTemplate
Source§fn config(&self) -> &TemplateConfig
fn config(&self) -> &TemplateConfig
Get the template configuration
Source§fn config_mut(&mut self) -> &mut TemplateConfig
fn config_mut(&mut self) -> &mut TemplateConfig
Get a mutable reference to the configuration
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, TemplateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, TemplateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the container with this template
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), TemplateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), TemplateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the container
Source§fn remove<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), TemplateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), TemplateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove the container
Source§fn build_command(&self) -> RunCommand
fn build_command(&self) -> RunCommand
Build the RunCommand for this template
Source§fn is_running<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_running<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the container is running
Auto Trait Implementations§
impl Freeze for RedisClusterTemplate
impl RefUnwindSafe for RedisClusterTemplate
impl Send for RedisClusterTemplate
impl Sync for RedisClusterTemplate
impl Unpin for RedisClusterTemplate
impl UnwindSafe for RedisClusterTemplate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more