nullnet_liblogging/datastore/
config.rs

1#[derive(Debug)]
2/// Datastore configuration
3pub struct DatastoreConfig {
4    pub(crate) app_id: String,
5    pub(crate) app_secret: String,
6    pub(crate) server_addr: String,
7    pub(crate) server_port: u16,
8}
9
10impl DatastoreConfig {
11    /// Creates a new `DatastoreConfig`
12    ///
13    /// # Arguments
14    ///
15    /// * `id` - Application or Account ID
16    /// * `secret` - Application or Account Secret
17    /// * `server_addr` - Server address (use `0.0.0.0` if running from the server itself)
18    /// * `server_port` - Server port
19    pub fn new<S: Into<String>>(id: S, secret: S, server_addr: S, server_port: u16) -> Self {
20        Self {
21            app_id: id.into(),
22            app_secret: secret.into(),
23            server_addr: server_addr.into(),
24            server_port,
25        }
26    }
27}