mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2026-02-03 05:55:51 +08:00
添加DNS账号时自动读取DNS服务商下域名
This commit is contained in:
@@ -59,6 +59,21 @@ func (this *CloudFlareProvider) Auth(params maps.Map) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetDomains 获取所有域名列表
|
||||
func (this *CloudFlareProvider) GetDomains() (domains []string, err error) {
|
||||
resp := new(cloudflare.ZonesResponse)
|
||||
err = this.doAPI(http.MethodGet, "zones", map[string]string{}, nil, resp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, zone := range resp.Result {
|
||||
domains = append(domains, zone.Name)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetRecords 获取域名解析记录列表
|
||||
func (this *CloudFlareProvider) GetRecords(domain string) (records []*dnstypes.Record, err error) {
|
||||
zoneId, err := this.findZoneIdWithDomain(domain)
|
||||
|
||||
Reference in New Issue
Block a user