Added send function

This commit is contained in:
int 80h
2020-04-22 20:15:23 -04:00
parent a3d3cc7214
commit ac75542dc6
4 changed files with 114 additions and 32 deletions

View File

@@ -13,7 +13,7 @@ pub struct Config {
#[derive(Debug, Deserialize, Clone)]
pub struct Server {
pub url: String,
pub hostname: String,
pub dir: String,
pub key: String,
pub cert: String,
@@ -25,10 +25,10 @@ impl Config {
let config: Config = toml::from_str(&fd).unwrap();
return config;
}
pub fn to_map(&self /*cfg: &config::Config*/) -> HashMap<String, String> {
pub fn to_map(&self) -> HashMap<String, String> {
let mut map = HashMap::new();
for srv in &self.server {
map.insert(srv.url.clone(), srv.dir.clone());
map.insert(srv.hostname.clone(), srv.dir.clone());
}
map
}