gandi-live-dns-rust/src/main.rs

22 lines
516 B
Rust
Raw Normal View History

2021-12-12 02:49:21 -06:00
use structopt::StructOpt;
2021-12-12 03:32:05 -06:00
use std::error::Error;
mod opts;
mod config;
2021-12-12 02:49:21 -06:00
2021-12-12 00:36:40 -06:00
2021-12-12 02:49:21 -06:00
fn gandi_api(fqdn: &str) -> String {
2021-12-12 00:36:40 -06:00
return format!("https://api.gandi.net/v5/livedns/domains/{}/records", fqdn);
}
2021-12-12 02:49:21 -06:00
fn main() -> Result<(), Box<dyn Error>> {
2021-12-12 03:32:05 -06:00
let opts = opts::Opts::from_args();
2021-12-12 02:49:21 -06:00
println!("{:#?}", opts);
2021-12-12 03:32:05 -06:00
let conf_path = config::config_path(&opts);
2021-12-12 02:49:21 -06:00
println!("{:#?}", conf_path);
2021-12-12 03:32:05 -06:00
let conf = config::load_config(conf_path);
2021-12-12 02:49:21 -06:00
println!("{:#?}", conf);
2021-12-12 00:36:40 -06:00
println!("Hello, world!");
2021-12-12 02:49:21 -06:00
return Ok(());
2021-12-12 00:36:40 -06:00
}