From 68084726c0ad698e358334bb9d869e00bbf12459 Mon Sep 17 00:00:00 2001 From: Patrik Kernstock Date: Thu, 8 Jun 2023 18:59:57 +0100 Subject: [PATCH] INWX: Implemented ListZones() support (#2428) Co-authored-by: Tom Limoncelli --- providers/inwx/inwxProvider.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/providers/inwx/inwxProvider.go b/providers/inwx/inwxProvider.go index 0180e3128..3c50f7c27 100644 --- a/providers/inwx/inwxProvider.go +++ b/providers/inwx/inwxProvider.go @@ -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 {