mirror of
https://github.com/SeriousBug/gandi-live-dns-rust
synced 2024-05-16 10:19:05 -05:00
24 lines
479 B
Rust
24 lines
479 B
Rust
|
use serde::Deserialize;
|
||
|
use std::error::Error;
|
||
|
use std::fs;
|
||
|
|
||
|
#[derive(Deserialize, Debug)]
|
||
|
struct Config {
|
||
|
fqdn: String,
|
||
|
}
|
||
|
|
||
|
fn gandi_api(fqdn: &String) {
|
||
|
return format!("https://api.gandi.net/v5/livedns/domains/{}/records", fqdn);
|
||
|
}
|
||
|
|
||
|
fn load_config(file: &String) -> Result<Config, Box<dyn Error>> {
|
||
|
let contents = fs::read_to_string(file)?.as_str();
|
||
|
|
||
|
let config = toml::from_str(contents)?;
|
||
|
return Ok(config);
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
println!("Hello, world!");
|
||
|
}
|