[SSL证书]实现基本的自动申请证书流程

This commit is contained in:
GoEdgeLab
2020-11-26 16:39:06 +08:00
parent 29cbabebf5
commit c1c83990d6
18 changed files with 594 additions and 27 deletions

View File

@@ -11,6 +11,8 @@ import (
// 阿里云服务商
type AliDNSProvider struct {
BaseProvider
accessKeyId string
accessKeySecret string
}
@@ -87,6 +89,20 @@ func (this *AliDNSProvider) GetRoutes(domain string) (routes []*Route, err error
return
}
// 查询单个记录
func (this *AliDNSProvider) QueryRecord(domain string, name string, recordType RecordType) (*Record, error) {
records, err := this.GetRecords(domain)
if err != nil {
return nil, err
}
for _, record := range records {
if record.Name == name && record.Type == recordType {
return record, nil
}
}
return nil, err
}
// 设置记录
func (this *AliDNSProvider) AddRecord(domain string, newRecord *Record) error {
req := alidns.CreateAddDomainRecordRequest()