bindy/lib.rs
1// Copyright (c) 2025 Erick Bourgeois, firestoned
2// SPDX-License-Identifier: MIT
3
4#![allow(unexpected_cfgs)]
5
6//! # Bindy - BIND9 DNS Controller for Kubernetes
7//!
8//! Bindy is a high-performance Kubernetes controller written in Rust that manages BIND9 DNS
9//! infrastructure through Custom Resource Definitions (CRDs).
10//!
11//! ## Overview
12//!
13//! This library provides the core functionality for the Bindy DNS controller, including:
14//!
15//! - Custom Resource Definitions (CRDs) for DNS zones and records
16//! - Reconciliation logic for managing BIND9 configurations
17//! - Zone file generation and management
18//! - Integration with Kubernetes API server
19//!
20//! ## Modules
21//!
22//! - [`crd`] - Custom Resource Definition types for DNS resources
23//! - [`reconcilers`] - Reconciliation logic for each resource type
24//! - [`bind9`] - BIND9 zone file generation and management
25//! - [`bind9_resources`] - BIND9 instance resource management
26//!
27//! ## Example
28//!
29//! ```rust,no_run
30//! use bindy::crd::{DNSZone, DNSZoneSpec, SOARecord};
31//!
32//! // Create a DNS zone specification
33//! let soa = SOARecord {
34//! primary_ns: "ns1.example.com.".to_string(),
35//! admin_email: "admin@example.com".to_string(),
36//! serial: 2024010101,
37//! refresh: 3600,
38//! retry: 600,
39//! expire: 604800,
40//! negative_ttl: 86400,
41//! };
42//!
43//! let zone_spec = DNSZoneSpec {
44//! zone_name: "example.com".to_string(),
45//! cluster_ref: Some("my-dns-cluster".to_string()),
46//! cluster_provider_ref: None,
47//! soa_record: soa,
48//! ttl: Some(3600),
49//! name_server_ips: None,
50//! records_from: None,
51//! };
52//! ```
53//!
54//! ## Features
55//!
56//! - **High Performance** - Native Rust with async/await
57//! - **Label Selectors** - Target specific BIND9 instances
58//! - **Multi-Record Types** - A, AAAA, CNAME, MX, TXT, NS, SRV, CAA
59//! - **Status Tracking** - Full status subresources
60//!
61//! For more information, see the [documentation](https://firestoned.github.io/bindy/).
62
63pub mod bind9;
64pub mod bind9_resources;
65pub mod constants;
66pub mod crd;
67pub mod crd_docs;
68pub mod dns_errors;
69pub mod http_errors;
70pub mod labels;
71pub mod metrics;
72pub mod reconcilers;
73pub mod status_reasons;
74
75#[cfg(test)]
76mod bind9_resources_tests;
77#[cfg(test)]
78mod crd_docs_tests;
79#[cfg(test)]
80mod crd_tests;
81#[cfg(test)]
82mod dns_errors_tests;
83#[cfg(test)]
84mod http_errors_tests;
85#[cfg(test)]
86mod status_reasons_tests;