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

GANDI: Bump go-gandi/go-gandi v0.0.0-20211124085723 => v0.1.0 (#1439)

* GANDI: Bump go-gandi/go-gandi v0.0.0-20211124085723-a737785a1af0 => v0.1.0

* Use new NewDomainClient signature

* go mod tidy
This commit is contained in:
Tom Limoncelli
2022-03-07 13:00:39 -05:00
committed by GitHub
parent 6ef4d791a1
commit 9db12e4730
3 changed files with 34 additions and 11 deletions

View File

@@ -21,7 +21,10 @@ import (
"strconv"
"strings"
gandi "github.com/go-gandi/go-gandi"
//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"
@@ -101,7 +104,11 @@ func newHelper(m map[string]string, metadata json.RawMessage) (*gandiv5Provider,
// ListZones lists the zones on this account.
func (client *gandiv5Provider) ListZones() ([]string, error) {
g := gandi.NewLiveDNSClient(client.apikey, gandi.Config{SharingID: client.sharingid, Debug: client.debug})
g := gandi.NewLiveDNSClient(config.Config{
APIKey: client.apikey,
SharingID: client.sharingid,
Debug: client.debug,
})
listResp, err := g.ListDomains()
if err != nil {
@@ -141,7 +148,11 @@ func (client *gandiv5Provider) GetDomainCorrections(dc *models.DomainConfig) ([]
// GetZoneRecords gathers the DNS records and converts them to
// dnscontrol's format.
func (client *gandiv5Provider) GetZoneRecords(domain string) (models.Records, error) {
g := gandi.NewLiveDNSClient(client.apikey, gandi.Config{SharingID: client.sharingid, Debug: client.debug})
g := gandi.NewLiveDNSClient(config.Config{
APIKey: client.apikey,
SharingID: client.sharingid,
Debug: client.debug,
})
// Get all the existing records:
records, err := g.GetDomainRecords(domain)
@@ -236,7 +247,11 @@ func (client *gandiv5Provider) GenerateDomainCorrections(dc *models.DomainConfig
_, desiredRecords := dc.Records.GroupedByFQDN()
doesLabelExist := existing.FQDNMap()
g := gandi.NewLiveDNSClient(client.apikey, gandi.Config{SharingID: client.sharingid, Debug: client.debug})
g := gandi.NewLiveDNSClient(config.Config{
APIKey: client.apikey,
SharingID: client.sharingid,
Debug: client.debug,
})
// For any key with an update, delete or replace those records.
for label := range affectedLabels {
@@ -346,7 +361,11 @@ func gatherAffectedLabels(groups map[models.RecordKey][]string) (labels map[stri
// GetNameservers returns a list of nameservers for domain.
func (client *gandiv5Provider) GetNameservers(domain string) ([]*models.Nameserver, error) {
g := gandi.NewLiveDNSClient(client.apikey, gandi.Config{SharingID: client.sharingid, Debug: client.debug})
g := gandi.NewLiveDNSClient(config.Config{
APIKey: client.apikey,
SharingID: client.sharingid,
Debug: client.debug,
})
nameservers, err := g.GetDomainNS(domain)
if err != nil {
return nil, err
@@ -356,7 +375,11 @@ func (client *gandiv5Provider) GetNameservers(domain string) ([]*models.Nameserv
// GetRegistrarCorrections returns a list of corrections for this registrar.
func (client *gandiv5Provider) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
gd := gandi.NewDomainClient(client.apikey, gandi.Config{SharingID: client.sharingid, Debug: client.debug})
gd := gandi.NewDomainClient(config.Config{
APIKey: client.apikey,
SharingID: client.sharingid,
Debug: client.debug,
})
existingNs, err := gd.GetNameServers(dc.Name)
if err != nil {