Struct sozu_command_lib::state::ConfigState
source · pub struct ConfigState {
pub clusters: BTreeMap<ClusterId, Cluster>,
pub backends: BTreeMap<ClusterId, Vec<Backend>>,
pub http_listeners: HashMap<SocketAddr, (HttpListener, bool)>,
pub https_listeners: HashMap<SocketAddr, (HttpsListener, bool)>,
pub tcp_listeners: HashMap<SocketAddr, (TcpListener, bool)>,
pub http_fronts: BTreeMap<RouteKey, HttpFrontend>,
pub https_fronts: BTreeMap<RouteKey, HttpFrontend>,
pub tcp_fronts: HashMap<ClusterId, Vec<TcpFrontend>>,
pub certificates: HashMap<SocketAddr, HashMap<CertificateFingerprint, (CertificateAndKey, Vec<String>)>>,
pub http_addresses: Vec<SocketAddr>,
pub https_addresses: Vec<SocketAddr>,
}
Fields§
§clusters: BTreeMap<ClusterId, Cluster>
§backends: BTreeMap<ClusterId, Vec<Backend>>
§http_listeners: HashMap<SocketAddr, (HttpListener, bool)>
the bool indicates if it is active or not
https_listeners: HashMap<SocketAddr, (HttpsListener, bool)>
§tcp_listeners: HashMap<SocketAddr, (TcpListener, bool)>
§http_fronts: BTreeMap<RouteKey, HttpFrontend>
indexed by (address, hostname, path)
https_fronts: BTreeMap<RouteKey, HttpFrontend>
indexed by (address, hostname, path)
tcp_fronts: HashMap<ClusterId, Vec<TcpFrontend>>
§certificates: HashMap<SocketAddr, HashMap<CertificateFingerprint, (CertificateAndKey, Vec<String>)>>
certificate and names
http_addresses: Vec<SocketAddr>
§https_addresses: Vec<SocketAddr>
Implementations§
source§impl ConfigState
impl ConfigState
pub fn new() -> Self
pub fn add_http_address(&mut self, address: SocketAddr)
pub fn add_https_address(&mut self, address: SocketAddr)
pub fn handle_order(&mut self, order: &ProxyRequestOrder) -> Result<()>
pub fn generate_orders(&self) -> Vec<ProxyRequestOrder>
pub fn generate_activate_orders(&self) -> Vec<ProxyRequestOrder>
pub fn diff(&self, other: &ConfigState) -> Vec<ProxyRequestOrder>
pub fn hash_state(&self) -> BTreeMap<ClusterId, u64>
pub fn cluster_state(&self, cluster_id: &str) -> QueryAnswerCluster
pub fn count_backends(&self) -> usize
pub fn count_frontends(&self) -> usize
Trait Implementations§
source§impl Clone for ConfigState
impl Clone for ConfigState
source§fn clone(&self) -> ConfigState
fn clone(&self) -> ConfigState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ConfigState
impl Debug for ConfigState
source§impl Default for ConfigState
impl Default for ConfigState
source§fn default() -> ConfigState
fn default() -> ConfigState
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ConfigState
impl<'de> Deserialize<'de> for ConfigState
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more