2023-07-04 10:25:59 +00:00
|
|
|
#[cfg(feature = "has-storage")]
|
2023-06-06 06:31:45 +00:00
|
|
|
use crate::net::client_ip::ClientIp;
|
2023-07-04 10:25:59 +00:00
|
|
|
#[cfg(feature = "has-storage")]
|
2023-08-10 06:33:38 +00:00
|
|
|
use std::sync::OnceLock;
|
2023-05-22 19:19:35 +00:00
|
|
|
use std::{net::SocketAddr, path::PathBuf};
|
2022-05-10 07:17:47 +00:00
|
|
|
|
2023-07-04 10:25:59 +00:00
|
|
|
#[cfg(feature = "has-storage")]
|
2023-08-10 06:33:38 +00:00
|
|
|
pub static CF: OnceLock<Config> = OnceLock::new();
|
2022-07-04 00:01:24 +00:00
|
|
|
|
2023-07-29 08:51:30 +00:00
|
|
|
use std::time::Duration;
|
|
|
|
|
2022-05-10 07:17:47 +00:00
|
|
|
#[derive(Clone, Debug)]
|
|
|
|
pub struct Config {
|
|
|
|
pub bind: SocketAddr,
|
|
|
|
pub path: String,
|
2023-07-04 10:25:59 +00:00
|
|
|
#[cfg(feature = "has-storage")]
|
2023-06-06 06:31:45 +00:00
|
|
|
pub client_ip: ClientIp,
|
2023-07-29 18:47:25 +00:00
|
|
|
pub user: Option<String>,
|
2022-07-24 00:11:32 +00:00
|
|
|
pub pass: Option<String>,
|
2023-05-22 19:19:35 +00:00
|
|
|
pub crt: Option<PathBuf>,
|
|
|
|
pub key: Option<PathBuf>,
|
2023-07-29 08:51:30 +00:00
|
|
|
pub tick_interval: Duration,
|
2022-05-10 07:17:47 +00:00
|
|
|
}
|