INWX: Implemented ListZones() support (#2428)

Co-authored-by: Tom Limoncelli <tal@whatexit.org>
This commit is contained in:
Patrik Kernstock 2023-06-08 18:59:57 +01:00 committed by GitHub
parent 3250681821
commit 68084726c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -343,6 +343,22 @@ func (api *inwxAPI) GetZoneRecords(domain string, meta map[string]string) (model
return records, nil
}
// ListZones returns the zones configured in INWX.
func (api *inwxAPI) ListZones() ([]string, error) {
if api.domainIndex == nil { // only pull the data once.
if err := api.fetchNameserverDomains(); err != nil {
return nil, err
}
}
var domains []string
for domain := range api.domainIndex {
domains = append(domains, domain)
}
return domains, nil
}
// updateNameservers is used by GetRegistrarCorrections to update the domain's nameservers.
func (api *inwxAPI) updateNameservers(ns []string, domain string) func() error {
return func() error {