removed code for dnsupdate
Dieser Commit ist enthalten in:
Ursprung
b8d49d91ba
Commit
e77d757bfd
3 geänderte Dateien mit 3 neuen und 64 gelöschten Zeilen
|
@ -1,43 +0,0 @@
|
|||
use macro_rules_attribute::apply;
|
||||
|
||||
use crate::{
|
||||
macros::{
|
||||
ConfigFile,
|
||||
DefDer,
|
||||
},
|
||||
types::{
|
||||
self,
|
||||
dns::Dns,
|
||||
structs::DnsToken,
|
||||
traits::DnsHandler,
|
||||
},
|
||||
};
|
||||
|
||||
#[apply(DefDer)]
|
||||
#[apply(ConfigFile)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct DNSUpdateClientOptions {}
|
||||
|
||||
impl DNSUpdateClientOptions {
|
||||
pub fn build(self, _zone: String) -> Dns {
|
||||
Dns::DNSUpdate(DnsUpdateHandler {})
|
||||
}
|
||||
}
|
||||
|
||||
#[apply(DefDer)]
|
||||
pub struct DnsUpdateHandler {}
|
||||
|
||||
impl DnsHandler for DnsUpdateHandler {
|
||||
async fn set_record(&self, _domain: String, _content: String) -> types::Result<DnsToken> {
|
||||
Ok(DnsToken::new_dns_update())
|
||||
}
|
||||
}
|
||||
|
||||
#[apply(DefDer)]
|
||||
pub struct DnsUpdateToken {}
|
||||
|
||||
impl DnsUpdateToken {
|
||||
pub async fn remove(&mut self) {}
|
||||
}
|
||||
|
||||
unsafe impl Send for DnsUpdateToken {}
|
|
@ -1,4 +1,3 @@
|
|||
pub(super) mod dnsupdate;
|
||||
pub(super) mod pdns;
|
||||
|
||||
use crate::{
|
||||
|
@ -8,15 +7,9 @@ use crate::{
|
|||
},
|
||||
types::{
|
||||
self,
|
||||
dns::{
|
||||
dnsupdate::{
|
||||
DNSUpdateClientOptions,
|
||||
DnsUpdateHandler,
|
||||
},
|
||||
pdns::{
|
||||
PdnsClientOptions,
|
||||
PdnsHandler,
|
||||
},
|
||||
dns::pdns::{
|
||||
PdnsClientOptions,
|
||||
PdnsHandler,
|
||||
},
|
||||
structs::{
|
||||
DnsToken,
|
||||
|
@ -86,7 +79,6 @@ impl Manager {
|
|||
fixed_zone,
|
||||
match builder {
|
||||
Builder::PowerDNS(pdns_client_options) => pdns_client_options.build(zone, self.1.clone()),
|
||||
Builder::DNSUpdate(dnsupdate_client_options) => dnsupdate_client_options.build(zone),
|
||||
Builder::None => Dns::None,
|
||||
},
|
||||
);
|
||||
|
@ -108,7 +100,6 @@ struct InnerManager {
|
|||
#[serde(tag = "type", rename_all = "lowercase")]
|
||||
pub enum Builder {
|
||||
PowerDNS(PdnsClientOptions),
|
||||
DNSUpdate(DNSUpdateClientOptions),
|
||||
#[default]
|
||||
None,
|
||||
}
|
||||
|
@ -116,7 +107,6 @@ pub enum Builder {
|
|||
#[apply(DefDer)]
|
||||
pub enum Dns {
|
||||
PowerDNS(PdnsHandler),
|
||||
DNSUpdate(DnsUpdateHandler),
|
||||
None,
|
||||
}
|
||||
|
||||
|
@ -124,7 +114,6 @@ impl Dns {
|
|||
pub async fn set_record(&self, domain: String, content: String) -> types::Result<DnsToken> {
|
||||
match self {
|
||||
Dns::PowerDNS(pdns_handler) => pdns_handler.set_record(domain, content).await,
|
||||
Dns::DNSUpdate(dns_update_handler) => dns_update_handler.set_record(domain, content).await,
|
||||
Dns::None => Error::err("Not Implemented"),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ use crate::{
|
|||
},
|
||||
dns::{
|
||||
Manager,
|
||||
dnsupdate::DnsUpdateToken,
|
||||
pdns::PdnsToken,
|
||||
},
|
||||
},
|
||||
|
@ -168,7 +167,6 @@ impl Error {
|
|||
pub enum DnsToken {
|
||||
None,
|
||||
Pdns(Box<PdnsToken>),
|
||||
DnsUpdate(DnsUpdateToken),
|
||||
}
|
||||
|
||||
impl DnsToken {
|
||||
|
@ -176,10 +174,6 @@ impl DnsToken {
|
|||
Self::Pdns(Box::new(PdnsToken::new(builder)))
|
||||
}
|
||||
|
||||
pub fn new_dns_update() -> Self {
|
||||
Self::DnsUpdate(DnsUpdateToken {})
|
||||
}
|
||||
|
||||
pub fn new_none() -> Self {
|
||||
Self::None
|
||||
}
|
||||
|
@ -188,7 +182,6 @@ impl DnsToken {
|
|||
match self {
|
||||
DnsToken::None => {},
|
||||
DnsToken::Pdns(pdns_token) => pdns_token.remove().await,
|
||||
DnsToken::DnsUpdate(dns_update_token) => dns_update_token.remove().await,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Laden …
Tabelle hinzufügen
In neuem Issue referenzieren