pub struct ZoneConfig {
pub zone: String,
pub zone_type: ZoneType,
pub file: Option<String>,
pub allow_update: Option<bool>,
pub allow_axfr: Option<bool>,
pub enable_dnssec: Option<bool>,
pub keys: Vec<KeyConfig>,
pub stores: Option<StoreConfig>,
}Expand description
Configuration for a zone
Fields§
§zone: Stringname of the zone
zone_type: ZoneTypetype of the zone
file: Option<String>location of the file (short for StoreConfig::FileConfig{zone_file_path})
allow_update: Option<bool>Deprecated allow_update, this is a Store option
allow_axfr: Option<bool>Allow AXFR (TODO: need auth)
enable_dnssec: Option<bool>Enable DnsSec TODO: should this move to StoreConfig?
keys: Vec<KeyConfig>Keys for use by the zone
stores: Option<StoreConfig>Store configurations, TODO: allow chained Stores
Implementations§
Source§impl ZoneConfig
impl ZoneConfig
Sourcepub fn new(
zone: String,
zone_type: ZoneType,
file: String,
allow_update: Option<bool>,
allow_axfr: Option<bool>,
enable_dnssec: Option<bool>,
keys: Vec<KeyConfig>,
) -> Self
pub fn new( zone: String, zone_type: ZoneType, file: String, allow_update: Option<bool>, allow_axfr: Option<bool>, enable_dnssec: Option<bool>, keys: Vec<KeyConfig>, ) -> Self
Return a new zone configuration
§Arguments
zone- name of a zone, e.g. example.comzone_type- Type of zone, e.g. Primary, Secondary, etc.file- relative to Config base path, to the zone fileallow_update- enable dynamic updatesallow_axfr- enable AXFR transfersenable_dnssec- enable signing of the zone for DNSSECkeys- list of private and public keys used to sign a zone
Sourcepub fn get_zone(&self) -> ProtoResult<Name>
pub fn get_zone(&self) -> ProtoResult<Name>
returns the name of the Zone, i.e. the example.com of www.example.com.
Sourcepub fn get_zone_type(&self) -> ZoneType
pub fn get_zone_type(&self) -> ZoneType
the type of the zone
Sourcepub fn get_file(&self) -> PathBuf
pub fn get_file(&self) -> PathBuf
path to the zone file, i.e. the base set of original records in the zone
this is ony used on first load, if dynamic update is enabled for the zone, then the journal file is the actual source of truth for the zone.
Sourcepub fn is_update_allowed(&self) -> bool
pub fn is_update_allowed(&self) -> bool
enable dynamic updates for the zone (see SIG0 and the registered keys)
Sourcepub fn is_axfr_allowed(&self) -> bool
pub fn is_axfr_allowed(&self) -> bool
enable AXFR transfers
Sourcepub fn is_dnssec_enabled(&self) -> bool
pub fn is_dnssec_enabled(&self) -> bool
declare that this zone should be signed, see keys for configuration of the keys for signing
Trait Implementations§
Source§impl Debug for ZoneConfig
impl Debug for ZoneConfig
Source§impl<'de> Deserialize<'de> for ZoneConfig
impl<'de> Deserialize<'de> for ZoneConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ZoneConfig
impl PartialEq for ZoneConfig
impl Eq for ZoneConfig
impl StructuralPartialEq for ZoneConfig
Auto Trait Implementations§
impl Freeze for ZoneConfig
impl !RefUnwindSafe for ZoneConfig
impl Send for ZoneConfig
impl Sync for ZoneConfig
impl Unpin for ZoneConfig
impl !UnwindSafe for ZoneConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.