pub struct L4LoadBalancer { /* private fields */ }Expand description
L4 Load Balancer implementation.
Implementations§
Source§impl L4LoadBalancer
impl L4LoadBalancer
Sourcepub fn add_vip(
&mut self,
vip_addr: String,
vip_port: u16,
algorithm: LbAlgorithm,
) -> Result<(), L4Error>
pub fn add_vip( &mut self, vip_addr: String, vip_port: u16, algorithm: LbAlgorithm, ) -> Result<(), L4Error>
Add a virtual IP.
Sourcepub fn remove_vip(
&mut self,
vip_addr: &str,
vip_port: u16,
) -> Result<(), L4Error>
pub fn remove_vip( &mut self, vip_addr: &str, vip_port: u16, ) -> Result<(), L4Error>
Remove a virtual IP.
Sourcepub fn add_backend(
&mut self,
vip_addr: &str,
vip_port: u16,
backend: Backend,
) -> Result<(), L4Error>
pub fn add_backend( &mut self, vip_addr: &str, vip_port: u16, backend: Backend, ) -> Result<(), L4Error>
Add a backend to a VIP.
Sourcepub fn remove_backend(
&mut self,
vip_addr: &str,
vip_port: u16,
backend_addr: &str,
) -> Result<(), L4Error>
pub fn remove_backend( &mut self, vip_addr: &str, vip_port: u16, backend_addr: &str, ) -> Result<(), L4Error>
Remove a backend from a VIP by address.
Sourcepub fn select_backend(
&mut self,
vip_addr: &str,
vip_port: u16,
client_ip: u32,
) -> Result<(String, u16), L4Error>
pub fn select_backend( &mut self, vip_addr: &str, vip_port: u16, client_ip: u32, ) -> Result<(String, u16), L4Error>
Select a backend using the VIP’s configured algorithm.
Sourcepub fn health_check(&mut self)
pub fn health_check(&mut self)
Run health checks on all backends in all VIPs.
Sourcepub fn set_backend_health(
&mut self,
vip_addr: &str,
vip_port: u16,
backend_addr: &str,
healthy: bool,
) -> Result<(), L4Error>
pub fn set_backend_health( &mut self, vip_addr: &str, vip_port: u16, backend_addr: &str, healthy: bool, ) -> Result<(), L4Error>
Mark a specific backend as healthy/unhealthy.