Documentation ¶
Index ¶
- Constants
- func DDNSTaskInfoMapDelete(key string)
- func DDNSTaskInfoMapUpdate(task *DDNSTaskInfo) bool
- 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 (d *DDNSTaskState) IPChanged(newAddr string) bool
- func (d *DDNSTaskState) Init(domains []string, mt int64)
- 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 = "等待更新" )
Variables ¶
This section is empty.
Functions ¶
func DDNSTaskInfoMapDelete ¶
func DDNSTaskInfoMapDelete(key string)
func DDNSTaskInfoMapUpdate ¶
func DDNSTaskInfoMapUpdate(task *DDNSTaskInfo) bool
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 { ddnsconf.DDNSTask TaskState DDNSTaskState `json:"TaskState"` }
func GetDDNSTaskInfoByKey ¶
func GetDDNSTaskInfoByKey(key string) *DDNSTaskInfo
func GetDDNSTaskInfoList ¶
func GetDDNSTaskInfoList() []*DDNSTaskInfo
func GetDDNSTaskState ¶
func GetDDNSTaskState(task *ddnsconf.DDNSTask) *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记录
func (*DDNSTaskInfo) SyncDomains ¶
func (d *DDNSTaskInfo) SyncDomains()
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"` ModifyTime int64 // contains filtered or unexported fields }
Domains Ipv4/Ipv6 DDNSTaskState
func (*DDNSTaskState) IPChanged ¶
func (d *DDNSTaskState) IPChanged(newAddr string) bool
Check 检测IP是否有改变
func (*DDNSTaskState) Init ¶
func (d *DDNSTaskState) Init(domains []string, mt int64)
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 { RawStr string 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.