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

@@ -30,7 +30,7 @@ func New(settings map[string]string, _ json.RawMessage) (providers.DNSServicePro
return nil, fmt.Errorf("missing netcup login parameters")
}
api := &api{}
api := &netcupProvider{}
err := api.login(settings["api-key"], settings["api-password"], settings["customer-number"])
if err != nil {
return nil, fmt.Errorf("login to netcup DNS failed, please check your credentials: %v", err)
@@ -39,7 +39,7 @@ func New(settings map[string]string, _ json.RawMessage) (providers.DNSServicePro
}
// GetZoneRecords gets the records of a zone and returns them in RecordConfig format.
func (api *api) GetZoneRecords(domain string) (models.Records, error) {
func (api *netcupProvider) GetZoneRecords(domain string) (models.Records, error) {
records, err := api.getRecords(domain)
if err != nil {
return nil, err
@@ -54,7 +54,7 @@ func (api *api) GetZoneRecords(domain string) (models.Records, error) {
// GetNameservers returns the nameservers for a domain.
// As netcup doesn't support setting nameservers over this API, these are static.
// Domains not managed by netcup DNS will return an error
func (api *api) GetNameservers(domain string) ([]*models.Nameserver, error) {
func (api *netcupProvider) GetNameservers(domain string) ([]*models.Nameserver, error) {
return models.ToNameservers([]string{
"root-dns.netcup.net",
"second-dns.netcup.net",
@@ -63,7 +63,7 @@ func (api *api) GetNameservers(domain string) ([]*models.Nameserver, error) {
}
// GetDomainCorrections returns the corrections for a domain.
func (api *api) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
func (api *netcupProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
dc, err := dc.Copy()
if err != nil {
return nil, err