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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 130 additions and 176 deletions

View file

@ -1,8 +1,6 @@
package main
import (
"log"
)
import "log"
func main() {
if err := generateFeatureMatrix(); err != nil {

View file

@ -7,11 +7,10 @@ import (
"sort"
"strings"
"github.com/urfave/cli/v2"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/js"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/urfave/cli/v2"
)
// categories of commands

View file

@ -2,10 +2,10 @@ package commands
import (
"fmt"
"github.com/urfave/cli/v2"
"github.com/StackExchange/dnscontrol/v3/pkg/credsfile"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/urfave/cli/v2"
)
var _ = cmd(catUtils, func() *cli.Command {

View file

@ -6,9 +6,8 @@ import (
"os"
"testing"
"github.com/andreyvit/diff"
_ "github.com/StackExchange/dnscontrol/v3/providers/_all"
"github.com/andreyvit/diff"
)
func TestFormatTypes(t *testing.T) {

View file

@ -6,8 +6,6 @@ import (
"os"
"strings"
"github.com/urfave/cli/v2"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/credsfile"
"github.com/StackExchange/dnscontrol/v3/pkg/nameservers"
@ -15,7 +13,7 @@ import (
"github.com/StackExchange/dnscontrol/v3/pkg/notifications"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/urfave/cli/v2"
"golang.org/x/exp/slices"
)

View file

@ -7,11 +7,10 @@ import (
"os"
"strings"
"github.com/urfave/cli/v2"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/js"
"github.com/StackExchange/dnscontrol/v3/pkg/normalize"
"github.com/urfave/cli/v2"
)
var _ = cmd(catDebug, func() *cli.Command {

View file

@ -203,7 +203,7 @@ func makeChanges(t *testing.T, prv providers.DNSServiceProvider, dc *models.Doma
dom2, _ := dom.Copy()
if err := providers.AuditRecords(*providerToRun, dom.Records); err != nil {
t.Skip(fmt.Sprintf("***SKIPPED(PROVIDER DOES NOT SUPPORT '%s' ::%q)", err, desc))
t.Skipf("***SKIPPED(PROVIDER DOES NOT SUPPORT '%s' ::%q)", err, desc)
return
}

View file

@ -1,8 +1,6 @@
package models
import (
"testing"
)
import "testing"
func TestRR(t *testing.T) {
experiment := RecordConfig{

View file

@ -1,8 +1,6 @@
package models
import (
"testing"
)
import "testing"
func TestIsQuoted(t *testing.T) {
tests := []struct {

View file

@ -1,8 +1,6 @@
package models
import (
"testing"
)
import "testing"
func TestToNameservers(t *testing.T) {
nss, e := ToNameservers([]string{"example.com", "example2.tld"})

View file

@ -9,7 +9,6 @@ import (
"strings"
"github.com/go-acme/lego/certificate"
"github.com/hashicorp/vault/api"
)

View file

@ -4,10 +4,9 @@ import (
"fmt"
"sort"
"github.com/gobwas/glob"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/gobwas/glob"
)
// Correlation stores a difference between two domains.

View file

@ -9,17 +9,15 @@ import (
"path/filepath"
"strings"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/transform"
"github.com/robertkrimen/otto" // load underscore js into vm by default
_ "github.com/robertkrimen/otto/underscore" // required by otto
"github.com/xddxdd/ottoext/fetch"
"github.com/xddxdd/ottoext/loop"
"github.com/xddxdd/ottoext/promise"
"github.com/xddxdd/ottoext/timers"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/transform"
)
//go:embed helpers.js

View file

@ -9,12 +9,11 @@ import (
"testing"
"unicode"
testifyrequire "github.com/stretchr/testify/require"
"github.com/StackExchange/dnscontrol/v3/pkg/normalize"
"github.com/StackExchange/dnscontrol/v3/pkg/prettyzone"
"github.com/StackExchange/dnscontrol/v3/providers"
_ "github.com/StackExchange/dnscontrol/v3/providers/_all"
testifyrequire "github.com/stretchr/testify/require"
)
const (

View file

@ -1,8 +1,6 @@
package rejectif
import (
"github.com/StackExchange/dnscontrol/v3/models"
)
import "github.com/StackExchange/dnscontrol/v3/models"
// Auditor stores a list of checks to be executed during Audit().
type Auditor struct {

View file

@ -1,7 +1,9 @@
package transform
import "testing"
import "fmt"
import (
"fmt"
"testing"
)
func TestReverse(t *testing.T) {
var tests = []struct {

View file

@ -1,8 +1,6 @@
package txtutil
import (
"github.com/StackExchange/dnscontrol/v3/models"
)
import "github.com/StackExchange/dnscontrol/v3/models"
// SplitSingleLongTxt finds TXT records with a single long string and splits it
// into 255-octet chunks. This is used by providers that, when a user specifies

View file

@ -10,6 +10,7 @@ https://github.com/akamai/AkamaiOPEN-edgegrid-golang
import (
"fmt"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
dnsv2 "github.com/akamai/AkamaiOPEN-edgegrid-golang/configdns-v2"

View file

@ -25,7 +25,7 @@ type ZoneListRequest struct {
Filter []*ZoneListFilter `json:"filters"`
}
func (api *autoDnsProvider) request(method string, requestPath string, data interface{}) ([]byte, error) {
func (api *autoDNSProvider) request(method string, requestPath string, data interface{}) ([]byte, error) {
client := &http.Client{}
requestURL := api.baseURL
@ -57,7 +57,7 @@ func (api *autoDnsProvider) request(method string, requestPath string, data inte
return responseText, nil
}
func (api *autoDnsProvider) findZoneSystemNameServer(domain string) (*models.Nameserver, error) {
func (api *autoDNSProvider) findZoneSystemNameServer(domain string) (*models.Nameserver, error) {
request := &ZoneListRequest{}
request.Filter = append(request.Filter, &ZoneListFilter{
@ -82,7 +82,7 @@ func (api *autoDnsProvider) findZoneSystemNameServer(domain string) (*models.Nam
return systemNameServer, nil
}
func (api *autoDnsProvider) getZone(domain string) (*Zone, error) {
func (api *autoDNSProvider) getZone(domain string) (*Zone, error) {
systemNameServer, err := api.findZoneSystemNameServer(domain)
if err != nil {
return nil, err
@ -100,7 +100,7 @@ func (api *autoDnsProvider) getZone(domain string) (*Zone, error) {
return responseObject.Data[0], nil
}
func (api *autoDnsProvider) updateZone(domain string, resourceRecords []*ResourceRecord, nameServers []*models.Nameserver, zoneTTL uint32) error {
func (api *autoDNSProvider) updateZone(domain string, resourceRecords []*ResourceRecord, nameServers []*models.Nameserver, zoneTTL uint32) error {
systemNameServer, err := api.findZoneSystemNameServer(domain)
if err != nil {

View file

@ -3,7 +3,6 @@ package autodns
import (
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"net/http"
"net/url"
"regexp"
@ -12,6 +11,7 @@ import (
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
)
@ -30,7 +30,7 @@ var features = providers.DocumentationNotes{
providers.CanUseTLSA: providers.Cannot(),
}
type autoDnsProvider struct {
type autoDNSProvider struct {
baseURL url.URL
defaultHeaders http.Header
}
@ -45,7 +45,7 @@ func init() {
// New creates a new API handle.
func New(settings map[string]string, _ json.RawMessage) (providers.DNSServiceProvider, error) {
api := &autoDnsProvider{}
api := &autoDNSProvider{}
api.baseURL = url.URL{
Scheme: "https",
@ -67,7 +67,7 @@ func New(settings map[string]string, _ json.RawMessage) (providers.DNSServicePro
}
// GetDomainCorrections returns the corrections for a domain.
func (api *autoDnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
func (api *autoDNSProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
var changes []*models.RecordConfig
dc, err := dc.Copy()
@ -169,7 +169,7 @@ func (api *autoDnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mo
err := api.updateZone(domain, resourceRecords, nameServers, zoneTTL)
if err != nil {
fmt.Errorf(err.Error())
return fmt.Errorf(err.Error())
}
return nil
@ -181,7 +181,7 @@ func (api *autoDnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mo
}
// GetNameservers returns the nameservers for a domain.
func (api *autoDnsProvider) GetNameservers(domain string) ([]*models.Nameserver, error) {
func (api *autoDNSProvider) GetNameservers(domain string) ([]*models.Nameserver, error) {
zone, err := api.getZone(domain)
if err != nil {
@ -192,7 +192,7 @@ func (api *autoDnsProvider) GetNameservers(domain string) ([]*models.Nameserver,
}
// GetZoneRecords gets the records of a zone and returns them in RecordConfig format.
func (api *autoDnsProvider) GetZoneRecords(domain string) (models.Records, error) {
func (api *autoDNSProvider) GetZoneRecords(domain string) (models.Records, error) {
zone, _ := api.getZone(domain)
existingRecords := make([]*models.RecordConfig, len(zone.ResourceRecords))
for i, resourceRecord := range zone.ResourceRecords {

View file

@ -5,6 +5,7 @@ import (
"github.com/StackExchange/dnscontrol/v3/providers/bind"
)
// ResourceRecord represents DNS records in API calls.
type ResourceRecord struct {
// The name of the record.
@ -29,6 +30,7 @@ type ResourceRecord struct {
Value string `json:"value,omitempty"`
}
// MainAddressRecord represents an address record in API calls.
type MainAddressRecord struct {
// TTL of the record (Optionally if not set then Default SOA TTL is used)
@ -38,6 +40,7 @@ type MainAddressRecord struct {
Value string `json:"address,omitempty"`
}
// Zone represents the Zone in API calls.
type Zone struct {
Origin string `json:"origin"`
@ -60,6 +63,7 @@ type Zone struct {
SystemNameServer string `json:"virtualNameServer,omitempty"`
}
// JSONResponseDataZone represents the response to the DataZone call.
type JSONResponseDataZone struct {
// The data for the response. The type of the objects are depending on the request and are also specified in the responseObject value of the response.

View file

@ -17,19 +17,18 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"math"
"math/rand"
"net"
"strings"
"time"
"github.com/miekg/dns"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/miekg/dns"
)
const (

View file

@ -11,7 +11,6 @@ import (
aauth "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
adns "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
"github.com/Azure/go-autorest/autorest/to"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"

View file

@ -22,15 +22,13 @@ import (
"strings"
"time"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/miekg/dns"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/prettyzone"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/miekg/dns"
)
var features = providers.DocumentationNotes{

View file

@ -1,8 +1,6 @@
package bind
import (
"github.com/StackExchange/dnscontrol/v3/models"
)
import "github.com/StackExchange/dnscontrol/v3/models"
func makeSoa(origin string, defSoa *SoaDefaults, existing, desired *models.RecordConfig) (*models.RecordConfig, uint32) {
// Create a SOA record. Take data from desired, existing, default,

View file

@ -2,9 +2,7 @@
package providers
import (
"log"
)
import "log"
// Capability is a bitmasked set of "features" that a provider supports. Only use constants from this package.
type Capability uint32

View file

@ -7,14 +7,13 @@ import (
"net"
"strings"
"github.com/cloudflare/cloudflare-go"
"github.com/miekg/dns/dnsutil"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/transform"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/cloudflare/cloudflare-go"
"github.com/miekg/dns/dnsutil"
)
/*

View file

@ -150,13 +150,13 @@ func (c *cloudflareProvider) createRec(rec *models.RecordConfig, domainID string
} else if rec.Type == "DS" {
cf.Data = cfDSData(rec)
}
if resp, err := c.cfClient.CreateDNSRecord(context.Background(), domainID, cf); err != nil {
resp, err := c.cfClient.CreateDNSRecord(context.Background(), domainID, cf)
if err != nil {
return err
} else {
// Updating id (from the outer scope) by side-effect, required for updating proxy mode
id = resp.Result.ID
return nil
}
// Updating id (from the outer scope) by side-effect, required for updating proxy mode
id = resp.Result.ID
return nil
},
}}
if rec.Metadata[metaProxy] != "off" {

View file

@ -6,11 +6,10 @@ import (
"strconv"
"strings"
"github.com/miekg/dns/dnsutil"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/miekg/dns/dnsutil"
)
/*

View file

@ -12,7 +12,6 @@ import (
"time"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/mattn/go-isatty"
)

View file

@ -1,8 +1,6 @@
package desec
import (
"github.com/StackExchange/dnscontrol/v3/models"
)
import "github.com/StackExchange/dnscontrol/v3/models"
// AuditRecords returns a list of errors corresponding to the records
// that aren't supported by this provider. If all records are

View file

@ -4,6 +4,7 @@ package desec
import (
"fmt"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
)

View file

@ -12,9 +12,8 @@ import (
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/miekg/dns/dnsutil"
"github.com/digitalocean/godo"
"github.com/miekg/dns/dnsutil"
"golang.org/x/oauth2"
)

View file

@ -8,13 +8,12 @@ import (
"strconv"
"strings"
dnsimpleapi "github.com/dnsimple/dnsimple-go/dnsimple"
"golang.org/x/oauth2"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/providers"
dnsimpleapi "github.com/dnsimple/dnsimple-go/dnsimple"
"golang.org/x/oauth2"
)
var features = providers.DocumentationNotes{

View file

@ -2,9 +2,10 @@ package dnsmadeeasy
import (
"fmt"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"net/http"
"time"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
)
type dnsMadeEasyProvider struct {

View file

@ -1,8 +1,6 @@
package domainnameshop
import (
"testing"
)
import "testing"
func TestFixTTL(t *testing.T) {
for i, test := range []struct {

View file

@ -4,14 +4,13 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"strings"
"github.com/exoscale/egoscale"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/exoscale/egoscale"
)
type exoscaleProvider struct {

View file

@ -5,10 +5,9 @@ package gandiv5
import (
"fmt"
"github.com/go-gandi/go-gandi/livedns"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/go-gandi/go-gandi/livedns"
)
// nativeToRecord takes a DNS record from Gandi and returns a native RecordConfig struct.

View file

@ -21,17 +21,14 @@ import (
"strconv"
"strings"
//gandi "github.com/go-gandi/go-gandi"
"github.com/go-gandi/go-gandi"
"github.com/go-gandi/go-gandi/config"
"github.com/miekg/dns/dnsutil"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/go-gandi/go-gandi"
"github.com/go-gandi/go-gandi/config"
"github.com/miekg/dns/dnsutil"
)
// Section 1: Register this provider in the system.

View file

@ -9,18 +9,15 @@ import (
"strings"
"time"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"google.golang.org/api/googleapi"
"google.golang.org/api/option"
gauth "golang.org/x/oauth2/google"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
gauth "golang.org/x/oauth2/google"
gdns "google.golang.org/api/dns/v1"
"google.golang.org/api/googleapi"
"google.golang.org/api/option"
)
var features = providers.DocumentationNotes{
@ -86,7 +83,7 @@ func New(cfg map[string]string, metadata json.RawMessage) (providers.DNSServiceP
var err error
hc, err = gauth.DefaultClient(ctx, "https://www.googleapis.com/auth/ndev.clouddns.readwrite")
if err != nil {
return nil, fmt.Errorf("No creds.json private_key found and ADC failed with:\n%s", err)
return nil, fmt.Errorf("no creds.json private_key found and ADC failed with:\n%s", err)
}
}
// FIXME(tlim): Is it a problem that ctx is included with hc and in

View file

@ -1,8 +1,9 @@
package hetzner
import (
"github.com/StackExchange/dnscontrol/v3/models"
"strings"
"github.com/StackExchange/dnscontrol/v3/models"
)
type bulkCreateRecordsRequest struct {

View file

@ -2,6 +2,7 @@ package hexonet
import (
"fmt"
"github.com/hexonet/go-sdk/v3/response"
)

View file

@ -4,6 +4,7 @@ package hexonet
import (
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/pkg/version"
"github.com/StackExchange/dnscontrol/v3/providers"
hxcl "github.com/hexonet/go-sdk/v3/apiclient"

View file

@ -4,13 +4,13 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"regexp"
"strconv"
"strings"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
)
@ -160,12 +160,13 @@ func toRecord(r *HXRecord, origin string) *models.RecordConfig {
return rc
}
func (n *HXClient) showCommand(cmd map[string]string) {
func (n *HXClient) showCommand(cmd map[string]string) error {
b, err := json.MarshalIndent(cmd, "", " ")
if err != nil {
fmt.Errorf("error: %w", err)
return fmt.Errorf("error: %w", err)
}
printer.Printf(string(b))
return nil
}
func (n *HXClient) updateZoneBy(params map[string]interface{}, domain string) error {

View file

@ -3,16 +3,15 @@ package inwx
import (
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"sort"
"strings"
"time"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/nrdcg/goinwx"
"github.com/pquerna/otp/totp"
)

View file

@ -9,12 +9,11 @@ import (
"regexp"
"strings"
"github.com/miekg/dns/dnsutil"
"golang.org/x/oauth2"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/miekg/dns/dnsutil"
"golang.org/x/oauth2"
)
/*

View file

@ -1,8 +1,6 @@
package linode
import (
"testing"
)
import "testing"
func TestFixTTL(t *testing.T) {
for i, test := range []struct {

View file

@ -114,7 +114,8 @@ func nativeToRecords(nr nativeRecord, origin string) (*models.RecordConfig, erro
// uprops["SerialNumber"], uprops["RefreshInterval"], uprops["RetryDelay"],
// uprops["ExpireLimit"], uprops["MinimumTimeToLive"])
case "TXT":
rc.SetTargetTXTString(sprops["DescriptiveText"])
//rc.SetTargetTXTString(sprops["DescriptiveText"])
rc.SetTargetTXTfromRFC1035Quoted(sprops["DescriptiveText"])
default:
return nil, fmt.Errorf(
"msdns/convert.go:nativeToRecord rtype=%q unknown: props=%+v and %+v",

View file

@ -4,9 +4,8 @@ import (
"encoding/json"
"runtime"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
)

View file

@ -7,11 +7,11 @@ import (
"bytes"
"encoding/hex"
"fmt"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"log"
"strconv"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
)
func generatePSCreateNaptr(dnsServerName, domain string, rec *models.RecordConfig) string {

View file

@ -7,9 +7,8 @@ import (
"log"
"os"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/TomOnTime/utfutil"
ps "github.com/bhendo/go-powershell"
"github.com/bhendo/go-powershell/backend"

View file

@ -7,13 +7,12 @@ import (
"strings"
"time"
nc "github.com/billputer/go-namecheap"
"golang.org/x/net/publicsuffix"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/providers"
nc "github.com/billputer/go-namecheap"
"golang.org/x/net/publicsuffix"
)
// NamecheapDefaultNs lists the default nameservers for this provider.

View file

@ -6,9 +6,8 @@ import (
"fmt"
"time"
"github.com/namedotcom/go/namecom"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/namedotcom/go/namecom"
)
const defaultAPIBase = "api.name.com"

View file

@ -6,10 +6,9 @@ import (
"regexp"
"strings"
"github.com/namedotcom/go/namecom"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/namedotcom/go/namecom"
)
var defaultNameservers = []*models.Nameserver{

View file

@ -1,8 +1,6 @@
package namedotcom
import (
"github.com/namedotcom/go/namecom"
)
import "github.com/namedotcom/go/namecom"
// ListZones returns all the zones in an account
func (n *namedotcomProvider) ListZones() ([]string, error) {

View file

@ -3,10 +3,9 @@ package netcup
import (
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
// no need for txtutil.SplitSingleLongTxt in function GetDomainCorrections
// "github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
)

View file

@ -8,13 +8,12 @@ import (
"strconv"
"strings"
"gopkg.in/ns1/ns1-go.v2/rest"
"gopkg.in/ns1/ns1-go.v2/rest/model/dns"
"gopkg.in/ns1/ns1-go.v2/rest/model/filter"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/providers"
"gopkg.in/ns1/ns1-go.v2/rest"
"gopkg.in/ns1/ns1-go.v2/rest/model/dns"
"gopkg.in/ns1/ns1-go.v2/rest/model/filter"
)
var docNotes = providers.DocumentationNotes{

View file

@ -22,7 +22,6 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"log"
"os"
"path/filepath"
@ -30,6 +29,7 @@ import (
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/StackExchange/dnscontrol/v3/providers/octodns/octoyaml"

View file

@ -4,14 +4,10 @@ import (
"encoding/json"
"os"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/transform"
"github.com/robertkrimen/otto"
// load underscore js into vm by default
_ "github.com/robertkrimen/otto/underscore" // required by otto
)

View file

@ -14,9 +14,8 @@ import (
"reflect"
"strconv"
yaml "gopkg.in/yaml.v2"
"github.com/StackExchange/dnscontrol/v3/models"
yaml "gopkg.in/yaml.v2"
)
// ReadYaml parses a yaml input and returns a list of RecordConfigs

View file

@ -9,7 +9,6 @@ import (
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/providers"
opensrs "github.com/philhug/opensrs-go/opensrs"
)

View file

@ -6,16 +6,14 @@ import (
"strings"
"time"
"github.com/oracle/oci-go-sdk/v32/dns"
"github.com/oracle/oci-go-sdk/v32/common"
"github.com/oracle/oci-go-sdk/v32/example/helpers"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/oracle/oci-go-sdk/v32/common"
"github.com/oracle/oci-go-sdk/v32/dns"
"github.com/oracle/oci-go-sdk/v32/example/helpers"
)
var features = providers.DocumentationNotes{

View file

@ -1,9 +1,10 @@
package powerdns
import (
"strings"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/mittwald/go-powerdns/apis/zones"
"strings"
)
// toRecordConfig converts a PowerDNS DNSRecord to a RecordConfig. #rtype_variations

View file

@ -2,11 +2,12 @@ package powerdns
import (
"fmt"
"github.com/mittwald/go-powerdns/apis/zones"
"strings"
"testing"
"github.com/mittwald/go-powerdns/apis/zones"
"github.com/stretchr/testify/assert"
)
import "github.com/stretchr/testify/assert"
func TestToRecordConfig(t *testing.T) {
record := zones.Record{

View file

@ -2,12 +2,13 @@ package powerdns
import (
"context"
"net/http"
"strings"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/mittwald/go-powerdns/apis/zones"
"github.com/mittwald/go-powerdns/pdnshttp"
"net/http"
"strings"
)
// GetNameservers returns the nameservers for a domain.

View file

@ -3,6 +3,7 @@ package powerdns
import (
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/providers"
pdns "github.com/mittwald/go-powerdns"

View file

@ -11,8 +11,11 @@ import (
"time"
"unicode/utf8"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
@ -20,11 +23,6 @@ import (
r53Types "github.com/aws/aws-sdk-go-v2/service/route53/types"
r53d "github.com/aws/aws-sdk-go-v2/service/route53domains"
r53dTypes "github.com/aws/aws-sdk-go-v2/service/route53domains/types"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v3/providers"
)
type route53Provider struct {

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")

View file

@ -3,18 +3,17 @@ package softlayer
import (
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"regexp"
"strings"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/softlayer/softlayer-go/datatypes"
"github.com/softlayer/softlayer-go/filter"
"github.com/softlayer/softlayer-go/services"
"github.com/softlayer/softlayer-go/session"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/providers"
)
// softlayerProvider is the protocol handle for this provider.

View file

@ -8,11 +8,10 @@ import (
"strconv"
"strings"
"github.com/vultr/govultr"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/diff"
"github.com/StackExchange/dnscontrol/v3/providers"
"github.com/vultr/govultr"
)
/*