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

Rename provider handles to *Provider (#914)

This commit is contained in:
Tom Limoncelli
2020-10-26 09:25:30 -04:00
committed by GitHub
parent 29c7ff3a05
commit ca30c9c34f
43 changed files with 318 additions and 318 deletions

View File

@@ -43,8 +43,8 @@ var allowedTTLValues = []uint32{
var srvRegexp = regexp.MustCompile(`^_(?P<Service>\w+)\.\_(?P<Protocol>\w+)$`)
// linodeAPI is the handle for this provider.
type linodeAPI struct {
// linodeProvider is the handle for this provider.
type linodeProvider struct {
client *http.Client
baseURL *url.URL
domainIndex map[string]int
@@ -75,7 +75,7 @@ func NewLinode(m map[string]string, metadata json.RawMessage) (providers.DNSServ
return nil, fmt.Errorf("invalid base URL for Linode")
}
api := &linodeAPI{client: client, baseURL: baseURL}
api := &linodeProvider{client: client, baseURL: baseURL}
// Get a domain to validate the token
if err := api.fetchDomainList(); err != nil {
@@ -97,12 +97,12 @@ func init() {
}
// GetNameservers returns the nameservers for a domain.
func (api *linodeAPI) GetNameservers(domain string) ([]*models.Nameserver, error) {
func (api *linodeProvider) GetNameservers(domain string) ([]*models.Nameserver, error) {
return models.ToNameservers(defaultNameServerNames)
}
// GetZoneRecords gets the records of a zone and returns them in RecordConfig format.
func (api *linodeAPI) GetZoneRecords(domain string) (models.Records, error) {
func (api *linodeProvider) GetZoneRecords(domain string) (models.Records, error) {
return nil, fmt.Errorf("not implemented")
// This enables the get-zones subcommand.
// Implement this by extracting the code from GetDomainCorrections into
@@ -110,7 +110,7 @@ func (api *linodeAPI) GetZoneRecords(domain string) (models.Records, error) {
}
// GetDomainCorrections returns the corrections for a domain.
func (api *linodeAPI) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
func (api *linodeProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
dc, err := dc.Copy()
if err != nil {
return nil, err