Struct autoconnect_settings::Settings
source · pub struct Settings {Show 25 fields
pub port: u16,
pub hostname: Option<String>,
pub resolve_hostname: bool,
pub router_port: u16,
pub router_hostname: Option<String>,
pub auto_ping_interval: Duration,
pub auto_ping_timeout: Duration,
pub open_handshake_timeout: Duration,
pub close_handshake_timeout: Duration,
pub endpoint_scheme: String,
pub endpoint_hostname: String,
pub endpoint_port: u16,
pub crypto_key: String,
pub statsd_host: Option<String>,
pub statsd_port: u16,
pub statsd_label: String,
pub db_dsn: Option<String>,
pub db_settings: String,
pub megaphone_api_url: Option<String>,
pub megaphone_api_token: Option<String>,
pub megaphone_poll_interval: Duration,
pub human_logs: bool,
pub msg_limit: u32,
pub actix_max_connections: Option<usize>,
pub actix_workers: Option<usize>,
}
Expand description
The Applications settings, read from CLI, Environment or settings file, for the autoconnect application. These are later converted to [autoconnect::autoconnect-settings::AppState].
Fields§
§port: u16
The application port to listen on
hostname: Option<String>
The DNS specified name of the application host to used for internal routing
resolve_hostname: bool
The override hostname to use for internal routing (NOTE: requires hostname
to be set)
router_port: u16
The internal webpush routing port
router_hostname: Option<String>
The DNS name to use for internal routing
auto_ping_interval: Duration
The server based ping interval (also used for Broadcast sends)
auto_ping_timeout: Duration
How long to wait for a response Pong before being timed out and connection drop
open_handshake_timeout: Duration
How long to wait for the initial connection handshake.
close_handshake_timeout: Duration
How long to wait while closing a connection for the response handshake.
endpoint_scheme: String
The URL scheme (http/https) for the endpoint URL
endpoint_hostname: String
The host url for the endpoint URL (differs from hostname
and resolve_hostname
)
endpoint_port: u16
The optional port override for the endpoint URL
crypto_key: String
The seed key to use for endpoint encryption
statsd_host: Option<String>
The host name to send recorded metrics
statsd_port: u16
The port number to send recorded metrics
statsd_label: String
The root label to apply to metrics.
db_dsn: Option<String>
The DSN to connect to the storage engine (Used to select between storage systems)
db_settings: String
JSON set of specific database settings (See data storage engines)
megaphone_api_url: Option<String>
Server endpoint to pull Broadcast ID change values (Sent in Pings)
megaphone_api_token: Option<String>
Broadcast token for authentication
megaphone_poll_interval: Duration
How often to poll the server for new data
human_logs: bool
Use human readable (simplified, non-JSON)
msg_limit: u32
Maximum allowed number of backlogged messages. Exceeding this number will trigger a user reset because the user may have been offline way too long.
actix_max_connections: Option<usize>
Sets the maximum number of concurrent connections per actix-web worker.
All socket listeners will stop accepting connections when this limit is reached for each worker.
actix_workers: Option<usize>
Sets number of actix-web workers to start (per bind address).
By default, the number of available physical CPUs is used as the worker count.
Implementations§
source§impl Settings
impl Settings
sourcepub fn with_env_and_config_files(
filenames: &[String],
) -> Result<Self, ConfigError>
pub fn with_env_and_config_files( filenames: &[String], ) -> Result<Self, ConfigError>
Load the settings from the config files in order first then the environment.
pub fn router_url(&self) -> String
pub fn endpoint_url(&self) -> String
pub fn validate(&self) -> Result<(), ConfigError>
pub fn test_settings() -> Self
Trait Implementations§
source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
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>,
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)