mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-11 18:08:57 +08: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:
parent
6ef4d791a1
commit
9db12e4730
3 changed files with 34 additions and 11 deletions
2
go.mod
2
go.mod
|
@ -30,7 +30,7 @@ require (
|
|||
github.com/exoscale/egoscale v0.59.0
|
||||
github.com/fatih/color v1.13.0 // indirect
|
||||
github.com/go-acme/lego v2.7.2+incompatible
|
||||
github.com/go-gandi/go-gandi v0.0.0-20211124085723-a737785a1af0
|
||||
github.com/go-gandi/go-gandi v0.1.0
|
||||
github.com/gobwas/glob v0.2.4-0.20181002190808-e7a84e9525fe
|
||||
github.com/gofrs/uuid v4.0.0+incompatible // indirect
|
||||
github.com/google/go-github/v35 v35.3.0
|
||||
|
|
8
go.sum
8
go.sum
|
@ -155,8 +155,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
|
|||
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
|
||||
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cloudflare/cloudflare-go v0.33.0 h1:5qiAeIHZsgno8WBpiybUNQUKLR1Wwm0U8paKowtwPL8=
|
||||
github.com/cloudflare/cloudflare-go v0.33.0/go.mod h1:JeaZN2TH2OKmiDDd9+34/kJrazqPliSdj+D0y8DpkIw=
|
||||
github.com/cloudflare/cloudflare-go v0.34.0 h1:FsZUCUABkSSyO329gxQRd9DT4/KPGuL3uRYLkjTDlPM=
|
||||
github.com/cloudflare/cloudflare-go v0.34.0/go.mod h1:JeaZN2TH2OKmiDDd9+34/kJrazqPliSdj+D0y8DpkIw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
|
@ -223,8 +221,8 @@ github.com/go-acme/lego v2.7.2+incompatible h1:ThhpPBgf6oa9X/vRd0kEmWOsX7+vmYdck
|
|||
github.com/go-acme/lego v2.7.2+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M=
|
||||
github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs=
|
||||
github.com/go-gandi/go-gandi v0.0.0-20211124085723-a737785a1af0 h1:CTHqxY6uf+bk3VIINZQsm3gXPDv0P6RzlL7z2Ac3U5U=
|
||||
github.com/go-gandi/go-gandi v0.0.0-20211124085723-a737785a1af0/go.mod h1:9rLNAOw2K3hRxNa3iNY+C7yHTiIr8n3x7/KaMiHnGAo=
|
||||
github.com/go-gandi/go-gandi v0.1.0 h1:lYPNy6LUJtR76C25pAcwXuos8WbPg+hX6R2ZPm/jf+8=
|
||||
github.com/go-gandi/go-gandi v0.1.0/go.mod h1:9NoYyfWCjFosClPiWjkbbRK5UViaZ4ctpT8/pKSSFlw=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
|
@ -536,6 +534,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw
|
|||
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
|
||||
github.com/peterhellberg/link v1.1.0 h1:s2+RH8EGuI/mI4QwrWGSYQCRz7uNgip9BaM04HKu5kc=
|
||||
github.com/peterhellberg/link v1.1.0/go.mod h1:gtSlOT4jmkY8P47hbTc8PTgiDDWpdPbFYl75keYyBB8=
|
||||
github.com/philhug/opensrs-go v0.0.0-20171126225031-9dfa7433020d h1:nf4+lHs8TQeIGFYZMcNg4iQOnZndLfYxnQaKEdqHVA4=
|
||||
github.com/philhug/opensrs-go v0.0.0-20171126225031-9dfa7433020d/go.mod h1:VDIGNBy0tHXMDAu4gxHFQJDq3NuwqUxw2Kok7wi+6ck=
|
||||
github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue