use std::time::Duration;
pub const DEFAULT_BASE_URL: &str = "https://api.finlight.me";
pub const DEFAULT_WSS_URL: &str = "wss://wss.finlight.me";
pub const DEFAULT_TIMEOUT: Duration = Duration::from_secs(5);
pub const DEFAULT_RETRY_COUNT: u32 = 3;
#[derive(Clone, Debug)]
pub struct Config {
pub api_key: String,
pub base_url: String,
pub wss_url: String,
pub timeout: Duration,
pub retry_count: u32,
}
impl Config {
pub fn new(api_key: impl Into<String>) -> Self {
Self {
api_key: api_key.into(),
base_url: DEFAULT_BASE_URL.to_owned(),
wss_url: DEFAULT_WSS_URL.to_owned(),
timeout: DEFAULT_TIMEOUT,
retry_count: DEFAULT_RETRY_COUNT,
}
}
}