pub struct SidecarProxy { /* private fields */ }Expand description
Sidecar proxy implementation.
Implementations§
Source§impl SidecarProxy
impl SidecarProxy
Sourcepub fn new(config: ProxyConfig) -> Self
pub fn new(config: ProxyConfig) -> Self
Create a new sidecar proxy.
Sourcepub fn handle_tcp(
&mut self,
payload: &[u8],
current_tick: u64,
) -> Result<Vec<u8>, ProxyError>
pub fn handle_tcp( &mut self, payload: &[u8], current_tick: u64, ) -> Result<Vec<u8>, ProxyError>
Handle a TCP connection by routing to an upstream.
Sourcepub fn handle_http(
&mut self,
_method: &str,
_path: &str,
payload: &[u8],
current_tick: u64,
) -> Result<Vec<u8>, ProxyError>
pub fn handle_http( &mut self, _method: &str, _path: &str, payload: &[u8], current_tick: u64, ) -> Result<Vec<u8>, ProxyError>
Handle an HTTP request by routing to an upstream.
Sourcepub fn health_check(&mut self, current_tick: u64)
pub fn health_check(&mut self, current_tick: u64)
Run health checks on all upstreams.
Sourcepub fn mark_unhealthy(&mut self, idx: usize)
pub fn mark_unhealthy(&mut self, idx: usize)
Mark an upstream as unhealthy.
Sourcepub fn mark_healthy(&mut self, idx: usize)
pub fn mark_healthy(&mut self, idx: usize)
Mark an upstream as healthy.
Sourcepub fn healthy_upstream_count(&self) -> usize
pub fn healthy_upstream_count(&self) -> usize
Get the number of healthy upstreams.
Sourcepub fn stats(&self) -> &ProxyStats
pub fn stats(&self) -> &ProxyStats
Get proxy stats.
Sourcepub fn pool(&self) -> &ConnectionPool
pub fn pool(&self) -> &ConnectionPool
Get connection pool.