use crate::dns; // TODO: Use model types instead of dns types as input / output and only convert internaly? // Zone content api // E.g.: DNS update + axfr, zone file read + write #[async_trait] pub trait RecordConnector { type Error; async fn get_records(&mut self, zone: dns::Name, class: dns::DNSClass) -> Result, Self::Error>; async fn add_records(&mut self, zone: dns::Name, class: dns::DNSClass, new_records: Vec) -> Result<(), Self::Error>; async fn update_records(&mut self, zone: dns::Name, class: dns::DNSClass, old_records: Vec, new_records: Vec) -> Result<(), Self::Error>; async fn delete_records(&mut self, zone: dns::Name, class: dns::DNSClass, records: Vec) -> Result<(), Self::Error>; // delete_records } // Zone management api, todo // E.g.: Manage catalog zone, dynamically generate knot / bind / nsd config... #[async_trait] pub trait ZoneConnector { type Error; // get_zones // add_zone // delete_zone async fn zone_exists(&mut self, zone: dns::Name, class: dns::DNSClass) -> Result<(), Self::Error>; }