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