mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-11 09:59:59 +08:00
29 lines
489 B
Go
29 lines
489 B
Go
package namedotcom
|
|
|
|
import (
|
|
"github.com/namedotcom/go/namecom"
|
|
)
|
|
|
|
// ListZones returns all the zones in an account
|
|
func (c *namedotcomProvider) ListZones() ([]string, error) {
|
|
var names []string
|
|
var page int32
|
|
|
|
for {
|
|
n, err := c.client.ListDomains(&namecom.ListDomainsRequest{Page: page})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
page = n.NextPage
|
|
|
|
for _, j := range n.Domains {
|
|
names = append(names, j.DomainName)
|
|
}
|
|
|
|
if page == 0 {
|
|
break
|
|
}
|
|
}
|
|
|
|
return names, nil
|
|
}
|