dnscontrol/providers/namedotcom/zones.go
Tom Limoncelli 886dbf6d00
MAINT: Make staticcheck more strict and fix new warnings (#1408)
* Make staticcheck more strict and fix new warnings
2022-02-11 14:30:45 -05:00

29 lines
510 B
Go

package namedotcom
import (
"github.com/namedotcom/go/namecom"
)
// ListZones returns all the zones in an account
func (n *namedotcomProvider) ListZones() ([]string, error) {
var names []string
var page int32
for {
response, err := n.client.ListDomains(&namecom.ListDomainsRequest{Page: page})
if err != nil {
return nil, err
}
page = response.NextPage
for _, j := range response.Domains {
names = append(names, j.DomainName)
}
if page == 0 {
break
}
}
return names, nil
}