pub struct Config {Show 35 fields
pub config_path: String,
pub command_socket: String,
pub command_buffer_size: u64,
pub max_command_buffer_size: u64,
pub max_connections: usize,
pub min_buffers: u64,
pub max_buffers: u64,
pub buffer_size: u64,
pub saved_state: Option<String>,
pub automatic_state_save: bool,
pub log_level: String,
pub log_target: String,
pub log_colored: bool,
pub access_logs_target: Option<String>,
pub access_logs_format: Option<AccessLogFormat>,
pub access_logs_colored: Option<bool>,
pub worker_count: u16,
pub worker_automatic_restart: bool,
pub metrics: Option<MetricsConfig>,
pub disable_cluster_metrics: bool,
pub http_listeners: Vec<HttpListenerConfig>,
pub https_listeners: Vec<HttpsListenerConfig>,
pub tcp_listeners: Vec<TcpListenerConfig>,
pub clusters: HashMap<String, ClusterConfig>,
pub handle_process_affinity: bool,
pub ctl_command_timeout: u64,
pub pid_file_path: Option<String>,
pub activate_listeners: bool,
pub front_timeout: u32,
pub back_timeout: u32,
pub connect_timeout: u32,
pub zombie_check_interval: u32,
pub accept_queue_timeout: u32,
pub request_timeout: u32,
pub worker_timeout: u32,
}
Expand description
Sōzu configuration, populated with clusters and listeners.
This struct is used on startup to generate WorkerRequest
s
Fields§
§config_path: String
§command_socket: String
§command_buffer_size: u64
§max_command_buffer_size: u64
§max_connections: usize
§min_buffers: u64
§max_buffers: u64
§buffer_size: u64
§saved_state: Option<String>
§automatic_state_save: bool
§log_level: String
§log_target: String
§log_colored: bool
§access_logs_target: Option<String>
§access_logs_format: Option<AccessLogFormat>
§access_logs_colored: Option<bool>
§worker_count: u16
§worker_automatic_restart: bool
§metrics: Option<MetricsConfig>
§disable_cluster_metrics: bool
§http_listeners: Vec<HttpListenerConfig>
§https_listeners: Vec<HttpsListenerConfig>
§tcp_listeners: Vec<TcpListenerConfig>
§clusters: HashMap<String, ClusterConfig>
§handle_process_affinity: bool
§ctl_command_timeout: u64
§pid_file_path: Option<String>
§activate_listeners: bool
§front_timeout: u32
§back_timeout: u32
§connect_timeout: u32
§zombie_check_interval: u32
§accept_queue_timeout: u32
§request_timeout: u32
§worker_timeout: u32
Implementations§
Source§impl Config
impl Config
Sourcepub fn load_from_path(path: &str) -> Result<Config, ConfigError>
pub fn load_from_path(path: &str) -> Result<Config, ConfigError>
Parse a TOML file and build a config out of it
Sourcepub fn generate_config_messages(
&self,
) -> Result<Vec<WorkerRequest>, ConfigError>
pub fn generate_config_messages( &self, ) -> Result<Vec<WorkerRequest>, ConfigError>
yields requests intended to recreate a proxy that match the config
Sourcepub fn command_socket_path(&self) -> Result<String, ConfigError>
pub fn command_socket_path(&self) -> Result<String, ConfigError>
Get the path of the UNIX socket used to communicate with Sōzu
Sourcepub fn load_file_bytes(path: &str) -> Result<Vec<u8>, ConfigError>
pub fn load_file_bytes(path: &str) -> Result<Vec<u8>, ConfigError>
read any file to bytes
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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
Source§impl From<&Config> for ServerConfig
reduce the config to the bare minimum needed by a worker
impl From<&Config> for ServerConfig
reduce the config to the bare minimum needed by a worker
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.