Struct autoendpoint::settings::Settings
source · pub struct Settings {Show 21 fields
pub scheme: String,
pub host: String,
pub port: u16,
pub endpoint_url: String,
pub db_dsn: Option<String>,
pub db_settings: String,
pub router_table_name: String,
pub message_table_name: String,
pub tracking_keys: String,
pub max_data_bytes: usize,
pub crypto_keys: String,
pub auth_keys: String,
pub human_logs: bool,
pub connection_timeout_millis: u64,
pub request_timeout_millis: u64,
pub statsd_host: Option<String>,
pub statsd_port: u16,
pub statsd_label: String,
pub fcm: FcmSettings,
pub apns: ApnsSettings,
pub stub: StubSettings,
}
Fields§
§scheme: String
§host: String
§port: u16
§endpoint_url: String
§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)
router_table_name: String
§message_table_name: String
§tracking_keys: String
A stringified JSON list of VAPID public keys which should be tracked internally.
This should ONLY include Mozilla generated and consumed messages (e.g. “SendToTab”, etc.)
These keys should be specified in stripped, b64encoded, X962 format (e.g. a single line of
base64 encoded data without padding).
You can use scripts/convert_pem_to_x962.py
to easily convert EC Public keys stored in
PEM format into appropriate x962 format.
max_data_bytes: usize
§crypto_keys: String
§auth_keys: String
§human_logs: bool
§connection_timeout_millis: u64
§request_timeout_millis: u64
§statsd_host: Option<String>
§statsd_port: u16
§statsd_label: String
§fcm: FcmSettings
§apns: ApnsSettings
§stub: StubSettings
Implementations§
source§impl Settings
impl Settings
sourcepub fn with_env_and_config_file(
filename: &Option<String>,
) -> Result<Self, ConfigError>
pub fn with_env_and_config_file( filename: &Option<String>, ) -> Result<Self, ConfigError>
Load the settings from the config file if supplied, then the environment.
sourcefn read_list_from_str<'list>(
list_str: &'list str,
panic_msg: &'static str,
) -> impl Iterator<Item = &'list str>
fn read_list_from_str<'list>( list_str: &'list str, panic_msg: &'static str, ) -> impl Iterator<Item = &'list str>
Convert a string like [item1,item2]
into a iterator over item1
and item2
.
Panics with a custom message if the string is not in the expected form.
sourcepub fn make_fernet(&self) -> MultiFernet
pub fn make_fernet(&self) -> MultiFernet
Initialize the fernet encryption instance
sourcepub fn tracking_keys(&self) -> Vec<String>
pub fn tracking_keys(&self) -> Vec<String>
Get the list of tracking public keys
sourcepub fn endpoint_url(&self) -> Url
pub fn endpoint_url(&self) -> Url
Get the URL for this endpoint server
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
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more