mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-11 01:47:53 +08:00
ccb582b278
* Remove deprecated io/ioutil * fixup! * staticcheck and linting * revert models/provider.go * Fix imports to new style * linting
27 lines
505 B
Go
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
|
|
}
|