@@ -9,15 +9,15 @@ import (
99 "strings"
1010)
1111
12- // 阿里云服务商
12+ // AliDNSProvider 阿里云服务商
1313type AliDNSProvider struct {
1414 BaseProvider
1515
1616 accessKeyId string
1717 accessKeySecret string
1818}
1919
20- // 认证
20+ // Auth 认证
2121func (this * AliDNSProvider ) Auth (params maps.Map ) error {
2222 this .accessKeyId = params .GetString ("accessKeyId" )
2323 this .accessKeySecret = params .GetString ("accessKeySecret" )
@@ -30,7 +30,7 @@ func (this *AliDNSProvider) Auth(params maps.Map) error {
3030 return nil
3131}
3232
33- // 获取域名列表
33+ // GetRecords 获取域名列表
3434func (this * AliDNSProvider ) GetRecords (domain string ) (records []* Record , err error ) {
3535 pageNumber := 1
3636 size := 100
@@ -70,7 +70,7 @@ func (this *AliDNSProvider) GetRecords(domain string) (records []*Record, err er
7070 return
7171}
7272
73- // 读取域名支持的线路数据
73+ // GetRoutes 读取域名支持的线路数据
7474func (this * AliDNSProvider ) GetRoutes (domain string ) (routes []* Route , err error ) {
7575 req := alidns .CreateDescribeSupportLinesRequest ()
7676 req .DomainName = domain
@@ -89,7 +89,7 @@ func (this *AliDNSProvider) GetRoutes(domain string) (routes []*Route, err error
8989 return
9090}
9191
92- // 查询单个记录
92+ // QueryRecord 查询单个记录
9393func (this * AliDNSProvider ) QueryRecord (domain string , name string , recordType RecordType ) (* Record , error ) {
9494 records , err := this .GetRecords (domain )
9595 if err != nil {
@@ -103,7 +103,7 @@ func (this *AliDNSProvider) QueryRecord(domain string, name string, recordType R
103103 return nil , err
104104}
105105
106- // 设置记录
106+ // AddRecord 设置记录
107107func (this * AliDNSProvider ) AddRecord (domain string , newRecord * Record ) error {
108108 req := alidns .CreateAddDomainRecordRequest ()
109109 req .RR = newRecord .Name
@@ -124,7 +124,7 @@ func (this *AliDNSProvider) AddRecord(domain string, newRecord *Record) error {
124124 return errors .New (resp .GetHttpContentString ())
125125}
126126
127- // 修改记录
127+ // UpdateRecord 修改记录
128128func (this * AliDNSProvider ) UpdateRecord (domain string , record * Record , newRecord * Record ) error {
129129 req := alidns .CreateUpdateDomainRecordRequest ()
130130 req .RecordId = record .Id
@@ -138,7 +138,7 @@ func (this *AliDNSProvider) UpdateRecord(domain string, record *Record, newRecor
138138 return err
139139}
140140
141- // 删除记录
141+ // DeleteRecord 删除记录
142142func (this * AliDNSProvider ) DeleteRecord (domain string , record * Record ) error {
143143 req := alidns .CreateDeleteDomainRecordRequest ()
144144 req .RecordId = record .Id
@@ -148,7 +148,7 @@ func (this *AliDNSProvider) DeleteRecord(domain string, record *Record) error {
148148 return err
149149}
150150
151- // 默认线路
151+ // DefaultRoute 默认线路
152152func (this * AliDNSProvider ) DefaultRoute () string {
153153 return "default"
154154}
0 commit comments