[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

@@ -14,6 +14,8 @@ import (
// DNSPod服务商
type DNSPodProvider struct {
BaseProvider
apiId string
apiToken string
}
@@ -104,6 +106,20 @@ func (this *DNSPodProvider) GetRoutes(domain string) (routes []*Route, err error
return routes, nil
}
// 查询单个记录
func (this *DNSPodProvider) 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 *DNSPodProvider) AddRecord(domain string, newRecord *Record) error {
if newRecord == nil {