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

CHORE: Linting (#1704)

* Remove deprecated io/ioutil
* fixup!
* staticcheck and linting
* revert models/provider.go
* Fix imports to new style
* linting
This commit is contained in:
Tom Limoncelli
2022-08-14 20:46:56 -04:00
committed by GitHub
parent e1b6b163d7
commit ccb582b278
73 changed files with 130 additions and 176 deletions

View File

@@ -22,6 +22,7 @@ const (
baseURL = "https://noc-portal.rz.rwth-aachen.de/dns-admin/api/v1"
)
// RecordReply represents a DNS Record in an API.
type RecordReply struct {
ID int `json:"id"`
ZoneID int `json:"zone_id"`

View File

@@ -2,11 +2,12 @@ package rwth
import (
"fmt"
"io"
"strings"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/prettyzone"
"github.com/miekg/dns"
"io"
"strings"
)
// Print the generateZoneFileHelper
@@ -46,6 +47,7 @@ func NewRR(s string) (dns.RR, error) {
return ReadRR(strings.NewReader(s))
}
// ReadRR reads an RR from r.
func ReadRR(r io.Reader) (dns.RR, error) {
zp := dns.NewZoneParser(r, ".", "")
zp.SetDefaultTTL(172800)

View File

@@ -2,11 +2,13 @@ package rwth
import (
"fmt"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
)
// RWTHDefaultNs is the default DNS NS for this provider.
var RWTHDefaultNs = []string{"dns-1.dfn.de", "dns-2.dfn.de", "zs1.rz.rwth-aachen.de", "zs2.rz.rwth-aachen.de"}
// GetZoneRecords gets the records of a zone and returns them in RecordConfig format.
@@ -27,6 +29,7 @@ func (api *rwthProvider) GetNameservers(domain string) ([]*models.Nameserver, er
return models.ToNameservers(RWTHDefaultNs)
}
// GetDomainCorrections returns a list of corretions to execute.
func (api *rwthProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
dc, err := dc.Copy()
if err != nil {

View File

@@ -3,6 +3,7 @@ package rwth
import (
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/providers"
)
@@ -38,6 +39,7 @@ func init() {
providers.RegisterDomainServiceProviderType("RWTH", fns, features)
}
// New allocates a DNS service provider.
func New(settings map[string]string, _ json.RawMessage) (providers.DNSServiceProvider, error) {
if settings["api_token"] == "" {
return nil, fmt.Errorf("missing RWTH api_token")