From ad86804f5661da383e23a31258771af5ec224222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louren=C3=A7o=20Vales?= <133565059+lourencovales@users.noreply.github.com> Date: Sun, 5 Oct 2025 23:13:58 +0200 Subject: [PATCH] small typos --- engine/resources/cloudflare_dns.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/engine/resources/cloudflare_dns.go b/engine/resources/cloudflare_dns.go index 5e6ddffd..fb5a8aa8 100644 --- a/engine/resources/cloudflare_dns.go +++ b/engine/resources/cloudflare_dns.go @@ -51,10 +51,10 @@ func init() { // CloudflareDNSRes is a resource for managing DNS records in Cloudflare zones. // This resource uses the Cloudflare API to create, update, and delete DNS // records in a specified zone. It supports various record types including A, -// AAAA, CNAME, MX, TXT, NS, and PTR records. The resource requires polling -// to detect changes, as the Cloudflare API does not provide an event stream. -// The Purge functionality allows enforcing that only managed DNS records exist -// in the zone, removing any unmanaged records. +// AAAA, CNAME, MX, TXT, NS, and PTR records. The resource requires polling to +// detect changes, as the Cloudflare API does not provide an event stream. The +// Purge functionality allows enforcing that only managed DNS records exist in +// the zone, removing any unmanaged records. type CloudflareDNSRes struct { traits.Base traits.GraphQueryable @@ -130,7 +130,7 @@ func (obj *CloudflareDNSRes) Validate() error { } if obj.APIToken == "" { - return fmt.Errorf("API token is required") + return fmt.Errorf("api token is required") } if obj.Type == "" { @@ -138,7 +138,7 @@ func (obj *CloudflareDNSRes) Validate() error { } if (obj.TTL < 60 || obj.TTL > 86400) && obj.TTL != 1 { // API requirement - return fmt.Errorf("TTL must be between 60s and 86400s, or set to 1") + return fmt.Errorf("ttl must be between 60s and 86400s, or set to 1") } if obj.Zone == "" { @@ -578,7 +578,7 @@ func (obj *CloudflareDNSRes) needsUpdate(record dns.RecordResponse) bool { return true } - // TODO add more checks? + //TODO: add more checks? return false @@ -679,16 +679,18 @@ func (obj *CloudflareDNSRes) GraphQueryAllowed(opts ...engine.GraphQueryableOpti return nil } -// matchesRecordName checks if a record name from the API matches our desired record name. -// Handles both FQDN (www.example.com) and short form (www) comparisons. +// matchesRecordName checks if a record name from the API matches our desired +// record name. Handles both FQDN (www.example.com) and short form (www) +// comparisons. func (obj *CloudflareDNSRes) matchesRecordName(apiRecordName string) bool { desired := obj.normalizeRecordName(obj.RecordName) actual := obj.normalizeRecordName(apiRecordName) return desired == actual } -// normalizeRecordName converts a record name to a consistent format for comparison. -// Converts to FQDN format (e.g., "www" -> "www.example.com", "@" -> "example.com") +// normalizeRecordName converts a record name to a consistent format for +// comparison. Converts to FQDN format (e.g., "www" -> "www.example.com", "@" -> +// "example.com") func (obj *CloudflareDNSRes) normalizeRecordName(name string) string { if name == "@" || name == obj.Zone { return obj.Zone