This commit is contained in:
Sense T
2024-04-09 16:28:18 +08:00
parent 2369734230
commit 7dd3af3707
20 changed files with 419 additions and 392 deletions

View File

@@ -32,13 +32,17 @@ func (Record) TableName() string {
return "coredns_record"
}
func (r *Record) CheckZone() error {
func (r Record) CheckZone() error {
if strings.HasSuffix(r.Zone, ".") {
return fmt.Errorf("zone should end with '.'")
}
return nil
}
func (r Record) WithOutDotTail() string {
return strings.TrimRight(r.Zone, ".")
}
type RecordContentTypes interface {
dns.ARecord | dns.AAAARecord | dns.CNAMERecord | dns.CAARecord | dns.NSRecord | dns.MXRecord | dns.SOARecord | dns.SRVRecord | dns.TXTRecord
}