technitium 0.4.0

Typed async Rust client for the Technitium DNS Server API
Documentation
mod common;

use technitium::RecordType;

#[tokio::test]
#[ignore = "requires running Technitium server"]
async fn resolve_a_record() {
    let client = common::authenticated_client().await;
    let result = client
        .resolve("example.com", RecordType::A)
        .await
        .expect("resolve should succeed");
    assert!(
        !result.answer.is_empty(),
        "should have at least one answer record"
    );
}

#[tokio::test]
#[ignore = "requires running Technitium server"]
async fn resolve_with_custom_server() {
    let client = common::authenticated_client().await;
    let result = client
        .resolve_with_options("example.com", RecordType::A, "1.1.1.1", None)
        .await
        .expect("resolve with custom server should succeed");
    assert!(
        !result.answer.is_empty(),
        "should have at least one answer record"
    );
}

#[tokio::test]
#[ignore = "requires running Technitium server"]
async fn resolve_with_doh() {
    let client = common::authenticated_client().await;
    let result = client
        .resolve_with_options(
            "example.com",
            RecordType::A,
            "https://cloudflare-dns.com/dns-query",
            Some(technitium::DnsProtocol::Https),
        )
        .await
        .expect("resolve with DoH should succeed");
    // DoH resolution may return empty from a container without internet
    let _ = result;
}