ddns

package
v1.10.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DDNSService *service.Service

Functions

func CopyHeadersMap

func CopyHeadersMap(sm map[string]string) map[string]string

func ResolveDomainAtServerList

func ResolveDomainAtServerList(queryType, domain string, dnsServerList []string) (string, error)

---------------------------------------------------------------------------------------------------

func Run

func Run(firstDelay time.Duration, delay time.Duration)

Run 定时运行

Types

type Alidns

type Alidns struct {
	DNSCommon
	TTL string
}

https://help.aliyun.com/document_detail/29776.html?spm=a2c4g.11186623.6.672.715a45caji9dMA Alidns Alidns

func (*Alidns) Init

func (ali *Alidns) Init(task *ddnscore.DDNSTaskInfo)

Init 初始化

type AlidnsRecord added in v1.2.1

type AlidnsRecord struct {
	DomainName string
	RecordID   string
	Value      string
}

AlidnsRecord record

type AlidnsResp

type AlidnsResp struct {
	RecordID  string
	RequestID string
}

AlidnsResp 修改/添加返回结果

type AlidnsSubDomainRecords

type AlidnsSubDomainRecords struct {
	TotalCount    int
	DomainRecords struct {
		Record []AlidnsRecord
	}
}

AlidnsSubDomainRecords 记录

type BaiduCloud

type BaiduCloud struct {
	DNSCommon
	TTL int
}

func (*BaiduCloud) Init

func (baidu *BaiduCloud) Init(task *ddnscore.DDNSTaskInfo)

type BaiduCreateRequest

type BaiduCreateRequest struct {
	Domain   string `json:"domain"`
	RdType   string `json:"rdType"`
	TTL      int    `json:"ttl"`
	Rdata    string `json:"rdata"`
	ZoneName string `json:"zoneName"`
}

BaiduCreateRequest 创建新解析请求的body json

type BaiduListRequest

type BaiduListRequest struct {
	Domain   string `json:"domain"`
	PageNum  int    `json:"pageNum"`
	PageSize int    `json:"pageSize"`
}

BaiduListRequest 获取解析列表请求的body json

type BaiduModifyRequest

type BaiduModifyRequest struct {
	RecordId uint   `json:"recordId"`
	Domain   string `json:"domain"`
	View     string `json:"view"`
	RdType   string `json:"rdType"`
	TTL      int    `json:"ttl"`
	Rdata    string `json:"rdata"`
	ZoneName string `json:"zoneName"`
}

BaiduModifyRequest 修改解析请求的body json

type BaiduRecord

type BaiduRecord struct {
	RecordId uint   `json:"recordId"`
	Domain   string `json:"domain"`
	View     string `json:"view"`
	Rdtype   string `json:"rdtype"`
	TTL      int    `json:"ttl"`
	Rdata    string `json:"rdata"`
	ZoneName string `json:"zoneName"`
	Status   string `json:"status"`
}

BaiduRecord 单条解析记录

type BaiduRecordsResp

type BaiduRecordsResp struct {
	TotalCount int           `json:"totalCount"`
	Result     []BaiduRecord `json:"result"`
}

BaiduRecordsResp 获取解析列表拿到的结果

type Callback

type Callback struct {
	DNSCommon
	TTL string
}

func (*Callback) CallbackHttpClientDo

func (cb *Callback) CallbackHttpClientDo(method, url, requestBody string, headers map[string]string, callbackSuccessContent []string) error

func (*Callback) Init

func (cb *Callback) Init(task *ddnscore.DDNSTaskInfo)

Init 初始化

type Cloudflare

type Cloudflare struct {
	DNSCommon
	TTL int
}

Cloudflare Cloudflare实现

func (*Cloudflare) Init

func (cf *Cloudflare) Init(task *ddnscore.DDNSTaskInfo)

Init 初始化

type CloudflareRecord

type CloudflareRecord struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Type    string `json:"type"`
	Content string `json:"content"`
	Proxied bool   `json:"proxied"`
	TTL     int    `json:"ttl"`
}

CloudflareRecord 记录实体

type CloudflareRecordsResp

type CloudflareRecordsResp struct {
	CloudflareStatus
	Result []CloudflareRecord
}

CloudflareRecordsResp records

type CloudflareStatus

type CloudflareStatus struct {
	Success  bool
	Messages []string
}

CloudflareStatus 公共状态

type CloudflareZonesResp

type CloudflareZonesResp struct {
	CloudflareStatus
	Result []struct {
		ID     string
		Name   string
		Status string
		Paused bool
	}
}

CloudflareZonesResp cloudflare zones返回结果

type DNS

type DNS interface {
	Init(task *ddnscore.DDNSTaskInfo)
	// 添加或更新IPv4/IPv6记录
	AddUpdateDomainRecords() string
}

DNS interface

type DNSCommon

type DNSCommon struct {
	// contains filtered or unexported fields
}

func (*DNSCommon) AddUpdateDomainRecords

func (d *DNSCommon) AddUpdateDomainRecords() string

添加或更新IPv4/IPv6记录

func (*DNSCommon) CreateHTTPClient

func (d *DNSCommon) CreateHTTPClient() (*http.Client, error)

func (*DNSCommon) Init

func (d *DNSCommon) Init(task *ddnscore.DDNSTaskInfo)

func (*DNSCommon) SetCreateUpdateDomainFunc

func (d *DNSCommon) SetCreateUpdateDomainFunc(f func(recordType, ipaddr string, domain *ddnscore.Domain))

type Dnspod

type Dnspod struct {
	DNSCommon
	TTL string
}

https://cloud.tencent.com/document/api/302/8516 Dnspod 腾讯云dns实现

func (*Dnspod) Init

func (dnspod *Dnspod) Init(task *ddnscore.DDNSTaskInfo)

Init 初始化

type DnspodRecordListResp

type DnspodRecordListResp struct {
	DnspodStatus
	Records []struct {
		ID      string
		Name    string
		Type    string
		Value   string
		Enabled string
	}
}

DnspodRecordListResp recordListAPI结果

type DnspodStatus

type DnspodStatus struct {
	Status struct {
		Code    string
		Message string
	}
}

DnspodStatus DnspodStatus

type GoDaddy added in v1.3.1

type GoDaddy struct {
	DNSCommon
	TTL int
	// contains filtered or unexported fields
}

func (*GoDaddy) Init added in v1.3.1

func (gd *GoDaddy) Init(task *ddnscore.DDNSTaskInfo)

Init 初始化

type Huaweicloud

type Huaweicloud struct {
	DNSCommon
	TTL int
}

https://support.huaweicloud.com/api-dns/dns_api_64001.html Huaweicloud Huaweicloud

func (*Huaweicloud) Init

func (hw *Huaweicloud) Init(task *ddnscore.DDNSTaskInfo)

Init 初始化

type HuaweicloudRecordsResp

type HuaweicloudRecordsResp struct {
	Recordsets []HuaweicloudRecordsets
}

HuaweicloudRecordsResp 记录返回结果

type HuaweicloudRecordsets

type HuaweicloudRecordsets struct {
	ID      string
	Name    string `json:"name"`
	ZoneID  string `json:"zone_id"`
	Status  string
	Type    string   `json:"type"`
	TTL     int      `json:"ttl"`
	Records []string `json:"records"`
}

HuaweicloudRecordsets 记录

type HuaweicloudZonesResp

type HuaweicloudZonesResp struct {
	Zones []struct {
		ID         string
		Name       string
		Recordsets []HuaweicloudRecordsets
	}
}

HuaweicloudZonesResp zones response

type Porkbun added in v1.2.1

type Porkbun struct {
	DNSCommon
	TTL string
}

func (*Porkbun) Init added in v1.2.1

func (pb *Porkbun) Init(task *ddnscore.DDNSTaskInfo)

Init 初始化

type PorkbunApiKey added in v1.2.1

type PorkbunApiKey struct {
	AccessKey string `json:"apikey"`
	SecretKey string `json:"secretapikey"`
}

type PorkbunDomainCreateOrUpdateVO added in v1.2.1

type PorkbunDomainCreateOrUpdateVO struct {
	*PorkbunApiKey
	*PorkbunDomainRecord
}

type PorkbunDomainQueryResponse added in v1.2.1

type PorkbunDomainQueryResponse struct {
	*PorkbunResponse
	Records []PorkbunDomainRecord `json:"records"`
}

type PorkbunDomainRecord added in v1.2.1

type PorkbunDomainRecord struct {
	Name    string `json:"name"`    // subdomain
	Type    string `json:"type"`    // record type, e.g. A AAAA CNAME
	Content string `json:"content"` // value
	Ttl     string `json:"ttl"`     // default 300
}

type PorkbunResponse added in v1.2.1

type PorkbunResponse struct {
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL