24 lines
492 B
Rust
24 lines
492 B
Rust
use std::{path::PathBuf, collections::HashMap};
|
|
|
|
use serde::Deserialize;
|
|
|
|
#[derive(Deserialize)]
|
|
pub struct Config {
|
|
pub repositories: HashMap<String, Repository>,
|
|
pub sources: HashMap<String, Source>,
|
|
pub options: HashMap<String, String>,
|
|
}
|
|
|
|
#[derive(Deserialize)]
|
|
pub struct Repository {
|
|
pub url: String,
|
|
pub password: String,
|
|
}
|
|
|
|
#[derive(Deserialize)]
|
|
#[serde(untagged)]
|
|
pub enum Source {
|
|
Path { path: PathBuf },
|
|
Stdin { command: String, filename: PathBuf },
|
|
}
|