Documentation
¶
Index ¶
Constants ¶
View Source
const ( RecordTypeA = "A" RecordTypeAAAA = "AAAA" )
RecordType DNS 记录类型
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LibDNSProvider ¶
type LibDNSProvider struct {
// contains filtered or unexported fields
}
LibDNSProvider 基于 libdns 的通用 DNS 提供商
func NewLibDNSProvider ¶
func NewLibDNSProvider(provider interface{}) (*LibDNSProvider, error)
NewLibDNSProvider 创建基于 libdns 的提供商
func (*LibDNSProvider) UpdateRecord ¶
func (p *LibDNSProvider) UpdateRecord(ctx context.Context, domain, recordType, ip string) error
UpdateRecord 更新 DNS 记录
type Provider ¶
type Provider interface {
// UpdateRecord 更新 DNS 记录
// domain: 完整域名,如 ddns.example.com
// recordType: 记录类型,A 或 AAAA
// ip: IP 地址
UpdateRecord(ctx context.Context, domain, recordType, ip string) error
// GetRecord 获取 DNS 记录
// domain: 完整域名
// recordType: 记录类型,A 或 AAAA
// 返回: 当前记录的 IP 地址
GetRecord(ctx context.Context, domain, recordType string) (string, error)
}
Provider DNS 服务商接口
Click to show internal directories.
Click to hide internal directories.