dnscontrol/providers/namedotcom/zones.go
Tom Limoncelli ccb582b278
CHORE: Linting (#1704)
* Remove deprecated io/ioutil
* fixup!
* staticcheck and linting
* revert models/provider.go
* Fix imports to new style
* linting
2022-08-14 20:46:56 -04:00

27 lines
505 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
}