mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-25 06:26:35 +08:00
[SSL证书]实现基本的自动申请证书流程
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user