rename nsd -> AuthoritativeNameServer
This commit is contained in:
parent
f4ded488ce
commit
1d616e822d
@ -4,12 +4,12 @@ use minijinja::{context, Environment};
|
|||||||
|
|
||||||
use crate::{container::Container, Domain, Result, CHMOD_RW_EVERYONE};
|
use crate::{container::Container, Domain, Result, CHMOD_RW_EVERYONE};
|
||||||
|
|
||||||
pub struct NsdContainer {
|
pub struct AuthoritativeNameServer {
|
||||||
child: Child,
|
child: Child,
|
||||||
container: Container,
|
container: Container,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NsdContainer {
|
impl AuthoritativeNameServer {
|
||||||
pub fn start(domain: Domain) -> Result<Self> {
|
pub fn start(domain: Domain) -> Result<Self> {
|
||||||
let container = Container::run()?;
|
let container = Container::run()?;
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ impl NsdContainer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for NsdContainer {
|
impl Drop for AuthoritativeNameServer {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let _ = self.child.kill();
|
let _ = self.child.kill();
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn tld_setup() -> Result<()> {
|
fn tld_setup() -> Result<()> {
|
||||||
let tld_ns = NsdContainer::start(Domain::Tld { domain: "com." })?;
|
let tld_ns = AuthoritativeNameServer::start(Domain::Tld { domain: "com." })?;
|
||||||
let ip_addr = tld_ns.ip_addr()?;
|
let ip_addr = tld_ns.ip_addr()?;
|
||||||
|
|
||||||
let client = Container::run()?;
|
let client = Container::run()?;
|
||||||
@ -99,7 +99,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn root_setup() -> Result<()> {
|
fn root_setup() -> Result<()> {
|
||||||
let root_ns = NsdContainer::start(Domain::Root)?;
|
let root_ns = AuthoritativeNameServer::start(Domain::Root)?;
|
||||||
let ip_addr = root_ns.ip_addr()?;
|
let ip_addr = root_ns.ip_addr()?;
|
||||||
|
|
||||||
let client = Container::run()?;
|
let client = Container::run()?;
|
@ -1,14 +1,12 @@
|
|||||||
use core::fmt;
|
pub use crate::authoritative_name_server::AuthoritativeNameServer;
|
||||||
|
|
||||||
pub use crate::nsd::NsdContainer;
|
|
||||||
|
|
||||||
pub type Error = Box<dyn std::error::Error>;
|
pub type Error = Box<dyn std::error::Error>;
|
||||||
pub type Result<T> = core::result::Result<T, Error>;
|
pub type Result<T> = core::result::Result<T, Error>;
|
||||||
|
|
||||||
const CHMOD_RW_EVERYONE: &str = "666";
|
const CHMOD_RW_EVERYONE: &str = "666";
|
||||||
|
|
||||||
|
mod authoritative_name_server;
|
||||||
mod container;
|
mod container;
|
||||||
mod nsd;
|
|
||||||
|
|
||||||
pub enum Domain<'a> {
|
pub enum Domain<'a> {
|
||||||
Root,
|
Root,
|
||||||
|
Loading…
Reference in New Issue
Block a user