Documentation
¶
Index ¶
- Constants
- func CleanIPUrlAddrMap()
- func DDNSTaskInfoMapDelete(key string)
- func DDNSTaskInfoMapUpdate(task *DDNSTaskInfo)
- func DDNSTaskInfoMapUpdateDomainInfo(task *DDNSTaskInfo)
- func DDNSTaskInfoMapUpdateIPInfo(task *DDNSTaskInfo)
- func DeleteAnyListlice(a []any, deleteIndex int) []any
- func EnableDDNSTaskByKey(key string, enable bool) error
- func FLushWebLastAccessDDNSTaskListLastTime()
- func UpdateDomainsStateByTaskKey(key, status, message string)
- func WebhookTest(d *DDNSTaskInfo, ...) (string, error)
- type DDNSTaskInfo
- type DDNSTaskState
- func (state *DDNSTaskState) IPChangeCheck(newAddr string) bool
- func (d *DDNSTaskState) Init(domains []string)
- func (d *DDNSTaskState) SetDomainUpdateStatus(status string, message string)
- func (d *DDNSTaskState) SetIPAddr(ipaddr string)
- func (d *DDNSTaskState) SetWebhookResult(result bool, errMsg string)
- type Domain
- type IPAddrHistoryItem
- type UpdateHistroyItem
- type WebhookCallHistroyItem
Constants ¶
View Source
const ( // UpdatedNothing 未改变 UpdatedNothing string = "域名IP和公网IP一致" // UpdatedFailed 更新失败 UpdatedFailed = "失败" // UpdatedSuccess 更新成功 UpdatedSuccess = "成功" // UpdateStop 暂停 UpdateStop = "停止同步" //UpdatePause 暂停 获取IP失败时暂停 UpdatePause = "暂停同步" // UpdateWaiting UpdateWaiting = "等待更新" )
View Source
const Ipv4Reg = `((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
const Ipv6Reg = `` /* 1065-byte string literal not displayed */
Ipv6Reg IPv6正则
Variables ¶
This section is empty.
Functions ¶
func CleanIPUrlAddrMap ¶
func CleanIPUrlAddrMap()
func DDNSTaskInfoMapDelete ¶
func DDNSTaskInfoMapDelete(key string)
func DDNSTaskInfoMapUpdate ¶
func DDNSTaskInfoMapUpdate(task *DDNSTaskInfo)
func DDNSTaskInfoMapUpdateDomainInfo ¶
func DDNSTaskInfoMapUpdateDomainInfo(task *DDNSTaskInfo)
func DDNSTaskInfoMapUpdateIPInfo ¶
func DDNSTaskInfoMapUpdateIPInfo(task *DDNSTaskInfo)
即时更新IP相关数据信息
func DeleteAnyListlice ¶
func EnableDDNSTaskByKey ¶
func FLushWebLastAccessDDNSTaskListLastTime ¶
func FLushWebLastAccessDDNSTaskListLastTime()
记录最后的前端请求DDNS任务列表时间
func UpdateDomainsStateByTaskKey ¶
func UpdateDomainsStateByTaskKey(key, status, message string)
func WebhookTest ¶
func WebhookTest(d *DDNSTaskInfo, url, method, WebhookRequestBody, proxy, addr, user, passwd string, headerList, successContentListraw []string) (string, error)
Types ¶
type DDNSTaskInfo ¶
type DDNSTaskInfo struct { config.DDNSTask TaskState DDNSTaskState `json:"TaskState"` }
func CreateDDNSTaskInfo ¶
func CreateDDNSTaskInfo(task *config.DDNSTask) *DDNSTaskInfo
func GetDDNSTaskInfoByKey ¶
func GetDDNSTaskInfoByKey(key string) *DDNSTaskInfo
func GetDDNSTaskInfoList ¶
func GetDDNSTaskInfoList() []*DDNSTaskInfo
func (*DDNSTaskInfo) CheckIPChange ¶
func (d *DDNSTaskInfo) CheckIPChange() (ipAddr string, change bool)
CheckIPChange 检测公网IP是否改变
func (*DDNSTaskInfo) ExecWebhook ¶
func (d *DDNSTaskInfo) ExecWebhook(state *DDNSTaskState)
ExecWebhook 添加或更新IPv4/IPv6记录
type DDNSTaskState ¶
type DDNSTaskState struct { IpAddr string Domains []Domain WebhookCallTime string `json:"WebhookCallTime"` //最后触发时间 WebhookCallResult bool `json:"WebhookCallResult"` //触发结果 WebhookCallErrorMsg string `json:"WebhookCallErrorMsg"` //触发错误信息 LastSyncTime time.Time `json:"-"` //记录最新一次同步操作时间 LastWorkTime time.Time `json:"-"` IPAddrHistory []any `json:"IPAddrHistory"` WebhookCallHistroy []any `json:"WebhookCallHistroy"` }
Domains Ipv4/Ipv6 DDNSTaskState
func (*DDNSTaskState) IPChangeCheck ¶
func (state *DDNSTaskState) IPChangeCheck(newAddr string) bool
Check 检测IP是否有改变
func (*DDNSTaskState) Init ¶
func (d *DDNSTaskState) Init(domains []string)
func (*DDNSTaskState) SetDomainUpdateStatus ¶
func (d *DDNSTaskState) SetDomainUpdateStatus(status string, message string)
func (*DDNSTaskState) SetIPAddr ¶
func (d *DDNSTaskState) SetIPAddr(ipaddr string)
func (*DDNSTaskState) SetWebhookResult ¶
func (d *DDNSTaskState) SetWebhookResult(result bool, errMsg string)
type Domain ¶
type Domain struct { DomainName string SubDomain string CustomParams string UpdateStatus string // 更新状态 LastUpdateStatusTime string //最后更新状态的时间 Message string UpdateHistroy []any }
Domain 域名实体
func (*Domain) GetCustomParams ¶
GetCustomParams not be nil
func (*Domain) GetSubDomain ¶
GetSubDomain 获得子域名,为空返回@ 阿里云,dnspod需要
func (*Domain) SetDomainUpdateStatus ¶
type IPAddrHistoryItem ¶
type UpdateHistroyItem ¶
type WebhookCallHistroyItem ¶
Click to show internal directories.
Click to hide internal directories.