Skip to main content

dnslib/vendors/
mod.rs

1use crate::control_plane::config::VendorKind;
2
3pub use crate::core::dns::service::{DnsRead, DnsService, DnsVendor, DnsWrite};
4
5pub mod http;
6pub mod runtime;
7
8#[cfg(feature = "technitium")]
9pub mod technitium;
10
11#[cfg(feature = "pangolin")]
12pub mod pangolin;
13
14#[cfg(feature = "cloudflare")]
15pub mod cloudflare;
16
17#[cfg(feature = "unifi")]
18pub mod unifi;
19
20#[cfg(feature = "pihole")]
21pub mod pihole;
22
23pub struct DnsClient<Vendor> {
24    vendor_id: VendorKind,
25    vendor_client: Vendor,
26}
27
28impl<Vendor> DnsClient<Vendor> {
29    pub fn new(vendor_id: VendorKind, vendor_client: Vendor) -> Self {
30        Self {
31            vendor_id,
32            vendor_client,
33        }
34    }
35
36    pub fn vendor_id(&self) -> VendorKind {
37        self.vendor_id
38    }
39
40    pub fn vendor_client(&self) -> &Vendor {
41        &self.vendor_client
42    }
43
44    pub fn into_vendor_client(self) -> Vendor {
45        self.vendor_client
46    }
47}