16 lines
324 B
Rust
16 lines
324 B
Rust
use serde::Deserialize;
|
|
|
|
use crate::proxy::Mirror;
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct Config {
|
|
pub mirrors: Vec<String>,
|
|
pub cache_dir: String,
|
|
pub no_cache: String,
|
|
}
|
|
|
|
impl Config {
|
|
pub fn to_proxy(&self) -> Mirror {
|
|
Mirror::new(self.mirrors.clone(), &self.cache_dir, &self.no_cache)
|
|
}
|
|
}
|