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

Refactor RecordConfig: Add getters/setters (#314)

* Replace RecordConfig.Name and .NameFQDN with getters and setters.
* Replace RecordConfig.Target with getters and setters.
* Eliminate the CombinedTarget concept.
* Add RecordConfig.PopulateFromString to reduce code in all providers.
* encode and decode name.com txt records (#315)
* Replace fmt.Errorf with errors.Errorf
This commit is contained in:
Tom Limoncelli
2018-02-15 12:02:50 -05:00
committed by GitHub
parent 324b1ea930
commit de4455942b
37 changed files with 1237 additions and 965 deletions

View File

@@ -18,7 +18,7 @@ import (
type zoneGenData struct {
Origin string
DefaultTtl uint32
DefaultTTL uint32
Records []dns.RR
}
@@ -146,7 +146,7 @@ func WriteZoneFile(w io.Writer, records []dns.RR, origin string) error {
z := &zoneGenData{
Origin: dnsutil.AddOrigin(origin, "."),
DefaultTtl: defaultTTL,
DefaultTTL: defaultTTL,
}
z.Records = nil
for _, r := range records {
@@ -161,7 +161,7 @@ func (z *zoneGenData) generateZoneFileHelper(w io.Writer) error {
nameShortPrevious := ""
sort.Sort(z)
fmt.Fprintln(w, "$TTL", z.DefaultTtl)
fmt.Fprintln(w, "$TTL", z.DefaultTTL)
for i, rr := range z.Records {
line := rr.String()
if line[0] == ';' {
@@ -187,7 +187,7 @@ func (z *zoneGenData) generateZoneFileHelper(w io.Writer) error {
// items[1]: ttl
ttl := ""
if hdr.Ttl != z.DefaultTtl && hdr.Ttl != 0 {
if hdr.Ttl != z.DefaultTTL && hdr.Ttl != 0 {
ttl = items[1]
}