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_resources;
70pub mod bootstrap;
71pub mod constants;
72pub mod context;
73pub mod crd;
74pub mod crd_docs;
75pub mod ddns;
76pub mod dns_errors;
77pub mod http_errors;
78pub mod labels;
79pub mod metrics;
80pub mod record_impls;
81pub mod record_operator;
82
83#[macro_use]
84pub mod record_wrappers;
85
86pub mod reconcilers;
87pub mod scout;
88pub mod selector;
89pub mod status_reasons;
90
91#[cfg(test)]
92mod bind9_resources_tests;
93#[cfg(test)]
94mod bootstrap_tests;
95#[cfg(test)]
96mod crd_docs_tests;
97#[cfg(test)]
98mod crd_tests;
99#[cfg(test)]
100mod dns_errors_tests;
101#[cfg(test)]
102mod http_errors_tests;
103#[cfg(test)]
104mod record_impls_tests;
105#[cfg(test)]
106mod record_operator_tests;
107#[cfg(test)]
108mod record_wrappers_tests;
109#[cfg(test)]
110mod scout_tests;
111#[cfg(test)]
112mod status_reasons_tests;