ddns

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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) GetRecord

func (p *LibDNSProvider) GetRecord(ctx context.Context, domain, recordType string) (string, error)

GetRecord 获取 DNS 记录

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 服务商接口

func NewProvider

func NewProvider(providerType string, config map[string]string) (Provider, error)

NewProvider 创建 DNS 提供商

Jump to

Keyboard shortcuts

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