melodium_repository/network/
config.rs

1#[derive(Clone, Debug)]
2pub struct Config {
3    pub user_agent: String,
4    pub base_url: String,
5}
6
7impl Config {
8    pub fn new() -> Self {
9        Self {
10            user_agent: format!(
11                "melodium-repository/{} ({}; {}; {})",
12                env!("CARGO_PKG_VERSION"),
13                env!("TARGET"),
14                env!("TARGET_FEATURE"),
15                env!("HOST")
16            ),
17            base_url: format!(
18                "https://repo.melodium.tech/mel/{}",
19                env!("CARGO_PKG_VERSION")
20            ),
21        }
22    }
23}
24
25impl Default for Config {
26    fn default() -> Self {
27        Self::new()
28    }
29}