pub struct CRDExamples;Expand description
§Examples
§Creating a DNS Zone
use bindy::crd::{DNSZone, DNSZoneSpec, SOARecord};
let soa = SOARecord {
primary_ns: "ns1.example.com.".to_string(),
admin_email: "admin@example.com".to_string(),
serial: 2024010101,
refresh: 3600,
retry: 600,
expire: 604800,
negative_ttl: 86400,
};
let spec = DNSZoneSpec {
zone_name: "example.com".to_string(),
cluster_ref: Some("my-dns-cluster".to_string()),
cluster_provider_ref: None,
soa_record: soa,
ttl: Some(3600),
name_server_ips: None,
records_from: None,
};§Creating DNS Records
use bindy::crd::{ARecordSpec, MXRecordSpec, TXTRecordSpec};
// A Record
let a_record = ARecordSpec {
name: "www".to_string(),
ipv4_address: "192.0.2.1".to_string(),
ttl: Some(300),
};
// MX Record
let mx_record = MXRecordSpec {
name: "@".to_string(),
priority: 10,
mail_server: "mail.example.com.".to_string(),
ttl: Some(3600),
};
// TXT Record (SPF)
let txt_record = TXTRecordSpec {
name: "@".to_string(),
text: vec!["v=spf1 include:_spf.example.com ~all".to_string()],
ttl: Some(3600),
};Auto Trait Implementations§
impl Freeze for CRDExamples
impl RefUnwindSafe for CRDExamples
impl Send for CRDExamples
impl Sync for CRDExamples
impl Unpin for CRDExamples
impl UnwindSafe for CRDExamples
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more