Documentation ¶
Index ¶
- Constants
- Variables
- func ExecWebhook(domains *Domains, conf *Config) (v4Status updateStatusType, v6Status updateStatusType)
- func GetNetInterface() (ipv4NetInterfaces []NetInterface, ipv6NetInterfaces []NetInterface, err error)
- type Config
- type DNS
- type DnsConfig
- type Domain
- type Domains
- type NetInterface
- type User
- type Webhook
Constants ¶
View Source
const ( // UpdatedNothing 未改变 UpdatedNothing updateStatusType = "未改变" // UpdatedFailed 更新失败 UpdatedFailed = "失败" // UpdatedSuccess 更新成功 UpdatedSuccess = "成功" )
Variables ¶
View Source
var Ipv4Reg = regexp.MustCompile(`((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])`)
Ipv4Reg IPv4正则
View Source
var Ipv6Reg = regexp.MustCompile(`((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))`)
Ipv6Reg IPv6正则
Functions ¶
func ExecWebhook ¶
func ExecWebhook(domains *Domains, conf *Config) (v4Status updateStatusType, v6Status updateStatusType)
ExecWebhook 添加或更新IPv4/IPv6记录, 返回是否有更新失败的
func GetNetInterface ¶
func GetNetInterface() (ipv4NetInterfaces []NetInterface, ipv6NetInterfaces []NetInterface, err error)
GetNetInterface 获得网卡地址 返回ipv4, ipv6地址
Types ¶
type Config ¶
func (*Config) CompatibleConfig ¶
func (conf *Config) CompatibleConfig()
CompatibleConfig 兼容v5.0.0之前的配置文件
type DnsConfig ¶
type DnsConfig struct { Ipv4 struct { Enable bool // 获取IP类型 url/netInterface GetType string URL string NetInterface string Cmd string Domains []string } Ipv6 struct { Enable bool // 获取IP类型 url/netInterface GetType string URL string NetInterface string Cmd string IPv6Reg string // ipv6匹配正则表达式 Domains []string } DNS DNS TTL string }
DnsConfig 配置
func (*DnsConfig) GetIpv6Addr ¶
GetIpv6Addr 获得IPv6地址
type Domain ¶
type Domain struct { // DomainName 根域名 DomainName string // SubDomain 子域名 SubDomain string CustomParams string UpdateStatus updateStatusType // 更新状态 }
Domain 域名实体
func (Domain) GetCustomParams ¶
GetCustomParams not be nil
func (Domain) GetSubDomain ¶
GetSubDomain 获得子域名,为空返回@ 阿里云/腾讯云/dnspod/GoDaddy/namecheap 需要
Click to show internal directories.
Click to hide internal directories.