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 Operator for Kubernetes
7//!
8//! Bindy is a high-performance Kubernetes operator 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 operator, 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//! - [`context`] - Shared context and reflector stores for operators
25//! - [`selector`] - Label selector matching utilities
26//! - [`bind9`] - BIND9 zone file generation and management
27//! - [`bind9_resources`] - BIND9 instance resource management
28//!
29//! ## Example
30//!
31//! ```rust,no_run
32//! # #[allow(deprecated)]
33//! use bindy::crd::{DNSZone, DNSZoneSpec, SOARecord};
34//!
35//! // Create a DNS zone specification
36//! let soa = SOARecord {
37//! primary_ns: "ns1.example.com.".to_string(),
38//! admin_email: "admin@example.com".to_string(),
39//! serial: 2024010101,
40//! refresh: 3600,
41//! retry: 600,
42//! expire: 604800,
43//! negative_ttl: 86400,
44//! };
45//!
46//! let zone_spec = DNSZoneSpec {
47//! zone_name: "example.com".to_string(),
48//! cluster_ref: None,
49//! soa_record: soa,
50//! ttl: Some(3600),
51//! name_servers: None,
52//! name_server_ips: None,
53//! records_from: None,
54//! bind9_instances_from: None,
55//! dnssec_policy: None,
56//! };
57//! ```
58//!
59//! ## Features
60//!
61//! - **High Performance** - Native Rust with async/await
62//! - **Label Selectors** - Target specific BIND9 instances
63//! - **Multi-Record Types** - A, AAAA, CNAME, MX, TXT, NS, SRV, CAA
64//! - **Status Tracking** - Full status subresources
65//!
66//! For more information, see the [documentation](https://firestoned.github.io/bindy/).
67
68pub mod bind9;
69pub mod bind9_acl;
70pub mod bind9_resources;
71pub mod bootstrap;
72pub mod constants;
73pub mod context;
74pub mod crd;
75pub mod crd_docs;
76pub mod ddns;
77pub mod dns_errors;
78pub mod http_errors;
79pub mod labels;
80pub mod metrics;
81pub mod record_impls;
82pub mod record_operator;
83pub mod safe_volume;
84
85#[macro_use]
86pub mod record_wrappers;
87
88pub mod reconcilers;
89pub mod scout;
90pub mod selector;
91pub mod status_reasons;
92
93#[cfg(test)]
94mod bind9_acl_tests;
95#[cfg(test)]
96mod bind9_resources_tests;
97#[cfg(test)]
98mod bootstrap_tests;
99#[cfg(test)]
100mod crd_docs_tests;
101#[cfg(test)]
102mod crd_tests;
103#[cfg(test)]
104mod dns_errors_tests;
105#[cfg(test)]
106mod http_errors_tests;
107#[cfg(test)]
108mod record_impls_tests;
109#[cfg(test)]
110mod record_operator_tests;
111#[cfg(test)]
112mod record_wrappers_tests;
113#[cfg(test)]
114mod scout_tests;
115#[cfg(test)]
116mod status_reasons_tests;