record should endwith .

This commit is contained in:
Sense T
2024-04-09 10:16:06 +08:00
parent c93e8107dc
commit 613ef7fdd9
3 changed files with 28 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package models
import (
"fmt"
"strings"
dns "github.com/cloud66-oss/coredns_mysql"
)
@@ -31,6 +32,13 @@ func (Record) TableName() string {
return "coredns_record"
}
func (r *Record) CheckZone() error {
if strings.HasSuffix(r.Zone, ".") {
return fmt.Errorf("zone should end with '.'")
}
return nil
}
type RecordContentTypes interface {
dns.ARecord | dns.AAAARecord | dns.CNAMERecord | dns.CAARecord | dns.NSRecord | dns.MXRecord | dns.SOARecord | dns.SRVRecord | dns.TXTRecord
}