Skip to content

Commit

Permalink
Add Cloudflare provider tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewmeyer committed Nov 5, 2024
1 parent 17f0cf9 commit 7b827eb
Show file tree
Hide file tree
Showing 3 changed files with 668 additions and 62 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ typetag = "0.2.18"
strip = true
lto = true
codegen-units = 1

[dev-dependencies]
wiremock = "0.6.2"
16 changes: 8 additions & 8 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ pub enum IpSource {
/// Update sent to each provider
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct IpUpdate {
v4: Option<IpAddr>,
v6: Option<IpAddr>,
pub v4: Option<IpAddr>,
pub v6: Option<IpAddr>,
}

impl IpUpdate {
pub fn as_array(&self) -> [(IpVersion, Option<IpAddr>); 2] {
[(IpVersion::V4, self.v4), (IpVersion::V6, self.v6)]
}
}

impl Display for IpUpdate {
Expand All @@ -65,12 +71,6 @@ impl Display for IpUpdate {
}
}

impl IpUpdate {
pub fn as_array(&self) -> [(IpVersion, Option<IpAddr>); 2] {
[(IpVersion::V4, self.v4), (IpVersion::V6, self.v6)]
}
}

/// Provider trait for updating DNS records or DDNS services
#[async_trait]
#[typetag::serde(tag = "type")]
Expand Down
Loading

0 comments on commit 7b827eb

Please sign in to comment.