mirror of
https://github.com/SeriousBug/gandi-live-dns-rust
synced 2024-05-18 03:09:04 -05:00
Fix lints
This commit is contained in:
parent
d32cae06cd
commit
62e81c7291
|
@ -6,9 +6,8 @@ use config::IPSourceName;
|
||||||
use ip_source::icanhazip::IPSourceIcanhazip;
|
use ip_source::icanhazip::IPSourceIcanhazip;
|
||||||
use reqwest::{header, Client, ClientBuilder, StatusCode};
|
use reqwest::{header, Client, ClientBuilder, StatusCode};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use tokio::time::sleep;
|
|
||||||
use std::{num::NonZeroU32, sync::Arc, time::Duration};
|
use std::{num::NonZeroU32, sync::Arc, time::Duration};
|
||||||
use tokio::{self, task::JoinHandle};
|
use tokio::{self, task::JoinHandle, time::sleep};
|
||||||
mod config;
|
mod config;
|
||||||
mod gandi;
|
mod gandi;
|
||||||
mod ip_source;
|
mod ip_source;
|
||||||
|
@ -41,7 +40,7 @@ pub struct APIPayload {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn run<IP: IPSource>(base_url: &str, conf: &Config) -> anyhow::Result<()> {
|
async fn run<IP: IPSource>(base_url: &str, conf: &Config) -> anyhow::Result<()> {
|
||||||
config::validate_config(&conf).die_with(|error| format!("Invalid config: {}", error));
|
config::validate_config(conf).die_with(|error| format!("Invalid config: {}", error));
|
||||||
println!("Finding out the IP address...");
|
println!("Finding out the IP address...");
|
||||||
let ipv4_result = IP::get_ipv4().await;
|
let ipv4_result = IP::get_ipv4().await;
|
||||||
let ipv6_result = IP::get_ipv6().await;
|
let ipv6_result = IP::get_ipv6().await;
|
||||||
|
@ -69,7 +68,7 @@ async fn run<IP: IPSource>(base_url: &str, conf: &Config) -> anyhow::Result<()>
|
||||||
|
|
||||||
for entry in &conf.entry {
|
for entry in &conf.entry {
|
||||||
for entry_type in Config::types(entry) {
|
for entry_type in Config::types(entry) {
|
||||||
let fqdn = Config::fqdn(entry, &conf).to_string();
|
let fqdn = Config::fqdn(entry, conf).to_string();
|
||||||
let url = GandiAPI {
|
let url = GandiAPI {
|
||||||
fqdn: &fqdn,
|
fqdn: &fqdn,
|
||||||
rrset_name: &entry.name,
|
rrset_name: &entry.name,
|
||||||
|
@ -84,7 +83,7 @@ async fn run<IP: IPSource>(base_url: &str, conf: &Config) -> anyhow::Result<()>
|
||||||
};
|
};
|
||||||
let payload = APIPayload {
|
let payload = APIPayload {
|
||||||
rrset_values: vec![ip.to_string()],
|
rrset_values: vec![ip.to_string()],
|
||||||
rrset_ttl: Config::ttl(entry, &conf),
|
rrset_ttl: Config::ttl(entry, conf),
|
||||||
};
|
};
|
||||||
let req = client.put(url).json(&payload);
|
let req = client.put(url).json(&payload);
|
||||||
let task_governor = governor.clone();
|
let task_governor = governor.clone();
|
||||||
|
|
Loading…
Reference in a new issue