mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-11 01:47:53 +08:00
e5de7b5359
* Restructure PowerDNS DSP based on layout for CSCGlobal Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me> * Rename api to dsp and make initializer function private Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me> Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
19 lines
427 B
Go
19 lines
427 B
Go
package powerdns
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
)
|
|
|
|
// ListZones returns all the zones in an account
|
|
func (dsp *powerdnsProvider) ListZones() ([]string, error) {
|
|
var result []string
|
|
myZones, err := dsp.client.Zones().ListZones(context.Background(), dsp.ServerName)
|
|
if err != nil {
|
|
return result, err
|
|
}
|
|
for _, zone := range myZones {
|
|
result = append(result, strings.TrimSuffix(zone.Name, "."))
|
|
}
|
|
return result, nil
|
|
}
|