1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Refactor in preparation to unexport RecordConfig.{Name,NameFQDN,Target} (#337)

* Preparing for the unexport of Name/NameFQDN/Target
* Cleanups
This commit is contained in:
Tom Limoncelli
2018-03-19 17:18:58 -04:00
committed by GitHub
parent cd58d26545
commit a7eba97ada
37 changed files with 298 additions and 270 deletions

View File

@@ -48,14 +48,14 @@ func (z *genYamlData) Less(i, j int) bool {
case "NS", "TXT", "TLSA":
// pass through.
case "A":
ta2, tb2 := net.ParseIP(a.Target), net.ParseIP(b.Target)
ta2, tb2 := net.ParseIP(a.GetTargetField()), net.ParseIP(b.GetTargetField())
ipa, ipb := ta2.To4(), tb2.To4()
if ipa == nil || ipb == nil {
log.Fatalf("should not happen: IPs are not 4 bytes: %#v %#v", ta2, tb2)
}
return bytes.Compare(ipa, ipb) == -1
case "AAAA":
ta2, tb2 := net.ParseIP(a.Target), net.ParseIP(b.Target)
ta2, tb2 := net.ParseIP(a.GetTargetField()), net.ParseIP(b.GetTargetField())
ipa, ipb := ta2.To16(), tb2.To16()
return bytes.Compare(ipa, ipb) == -1
case "MX":
@@ -75,7 +75,7 @@ func (z *genYamlData) Less(i, j int) bool {
return pa < pb
}
case "PTR":
pa, pb := a.Target, b.Target
pa, pb := a.GetTargetField(), b.GetTargetField()
if pa != pb {
return pa < pb
}