17 lines
397 B
Rust
17 lines
397 B
Rust
#[derive(Debug, serde::Deserialize)]
|
|
pub struct Config {
|
|
pub indexer: String,
|
|
pub hosts: Vec<String>,
|
|
pub interval_after_error: u64,
|
|
pub max_workers: usize,
|
|
}
|
|
|
|
impl Config {
|
|
pub fn load_file(path: &str) -> Self {
|
|
let config_file = std::fs::read_to_string(path)
|
|
.expect(path);
|
|
serde_yaml::from_str(&config_file)
|
|
.expect("config")
|
|
}
|
|
}
|