bindy/crd_docs.rs
1// Copyright (c) 2025 Erick Bourgeois, firestoned
2// SPDX-License-Identifier: MIT
3
4//! Module-level documentation for CRD types
5//!
6//! This file contains additional doc examples that will be included in the API reference.
7
8/// # Examples
9///
10/// ## Creating a DNS Zone
11///
12/// ```rust,no_run
13/// use bindy::crd::{DNSZone, DNSZoneSpec, SOARecord};
14///
15/// let soa = SOARecord {
16/// primary_ns: "ns1.example.com.".to_string(),
17/// admin_email: "admin@example.com".to_string(),
18/// serial: 2024010101,
19/// refresh: 3600,
20/// retry: 600,
21/// expire: 604800,
22/// negative_ttl: 86400,
23/// };
24///
25/// let spec = DNSZoneSpec {
26/// zone_name: "example.com".to_string(),
27/// cluster_ref: Some("my-dns-cluster".to_string()),
28/// cluster_provider_ref: None,
29/// soa_record: soa,
30/// ttl: Some(3600),
31/// name_server_ips: None,
32/// records_from: None,
33/// };
34/// ```
35///
36/// ## Creating DNS Records
37///
38/// ```rust,no_run
39/// use bindy::crd::{ARecordSpec, MXRecordSpec, TXTRecordSpec};
40///
41/// // A Record
42/// let a_record = ARecordSpec {
43/// name: "www".to_string(),
44/// ipv4_address: "192.0.2.1".to_string(),
45/// ttl: Some(300),
46/// };
47///
48/// // MX Record
49/// let mx_record = MXRecordSpec {
50/// name: "@".to_string(),
51/// priority: 10,
52/// mail_server: "mail.example.com.".to_string(),
53/// ttl: Some(3600),
54/// };
55///
56/// // TXT Record (SPF)
57/// let txt_record = TXTRecordSpec {
58/// name: "@".to_string(),
59/// text: vec!["v=spf1 include:_spf.example.com ~all".to_string()],
60/// ttl: Some(3600),
61/// };
62/// ```
63pub struct CRDExamples;