pub mod cloudflare; use std::net::IpAddr; use anyhow::Result; use serde::Deserialize; #[derive(Debug, Clone, Deserialize)] pub struct DnsRecord { pub id: String, #[serde(rename = "type")] pub kind: String, pub content: String, } /// The record operations the monitor needs, scoped to one zone. pub trait DnsProvider { /// All records (any type) whose name is exactly `name`. fn records(&self, name: &str) -> impl Future>>; /// Creates an A or AAAA record, whichever fits `ip`. fn create(&self, name: &str, ip: IpAddr, ttl: u32) -> impl Future>; fn delete(&self, record_id: &str) -> impl Future>; }