dnscontrol/vendor/github.com/tiramiseb/go-gandi/gandi.go
Tom Limoncelli f708f19535
Update many modules (#620)
* Update many modules.

go get -u golang.org/x/net
go get -u github.com/aws/aws-sdk-go
go get -u golang.org/x/oauth2
go get -u google.golang.org/api
go get -u gopkg.in/yaml.v2
go mod tidy

* Update modules

go get -u github.com/tiramiseb/go-gandi
go get -u github.com/miekg/dns
go mod tidy
2020-02-12 21:16:35 -05:00

28 lines
997 B
Go

package gandi
import (
"github.com/tiramiseb/go-gandi/domain"
"github.com/tiramiseb/go-gandi/livedns"
)
// Config manages common config for all Gandi API types
type Config struct {
// SharingID is the Organization ID, available from the Organization API
SharingID string
// Debug enables verbose debugging of HTTP calls
Debug bool
// DryRun prevents the API from making changes. Only certain API calls support it.
DryRun bool
}
// NewDomainClient returns a client to the Gandi Domains API
// It expects an API key, available from https://account.gandi.net/en/
func NewDomainClient(apikey string, config Config) *domain.Domain {
return domain.New(apikey, config.SharingID, config.Debug, config.DryRun)
}
// NewLiveDNSClient returns a client to the Gandi Domains API
// It expects an API key, available from https://account.gandi.net/en/
func NewLiveDNSClient(apikey string, config Config) *livedns.LiveDNS {
return livedns.New(apikey, config.SharingID, config.Debug, config.DryRun)
}