1 Star 0 Fork 1

坐公交也用券/ddns-go

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
data.go 4.24 KB
一键复制 编辑 原始数据 按行查看 历史
坐公交也用券 提交于 2025-05-08 16:57 +08:00 . 增加指定网卡功能
package model
import "net"
type Login struct {
Debug bool `json:"debug"` // 是否开启Debug
IPS IP `json:"ips"` // 从云端查询到的IP信息
RecordId int `json:"recordId"` // 记录id
RecordId4 int `json:"recordId4"` // 记录id
RecordId6 int `json:"recordId6"` // 记录id
Value string `json:"value"` // 解析值
Exists bool `json:"exists"` // 是否存在记录
Err error `json:"err"` // 错误信息
Url string `json:"url"` // 拼接域名后的完整地址
SubList []string `json:"subList"` // 子域名解析列表
DomainInfoList []DomainInfo `json:"domainInfoList"` // 域名信息
Pids Pid `json:"Pids"` // PID信息
Domain *DomainConfig `json:"Domain"` // 域名配置
ConfigFile string `json:"configFile"` // 配置文件路径
}
type EthInfo struct {
Name string `json:"name"` // 网卡名称
IP net.IP `json:"ip"` // 网卡IP
}
type Pid struct {
File string `json:"file"` // 文件路径
Write bool `json:"write"` // 是否写入
}
type DomainInfo struct {
Sub string // 子域名
Ip string // 解析值
RecordId int // RecordId
Type string // 解析类型
DomainId int // 域名ID
}
// IP 定义对应的结构体
type IP struct {
Ip string `json:"ip"` // 本次需要更新的本机IP
IpType string `json:"ip_type"` // ip类型
Debug bool `json:"debug"` // 是否开启Debug
Err error `json:"err"` // 错误信息
Out string `json:"out"` // 命令行输出
Pre string `json:"pre"` //
IP4 string `json:"IP4"` // ipv4
IP6 string `json:"IP6"` // ipv6
SetV6 bool `json:"setV6"` // 是否设置ipv6
SetV4 bool `json:"setV4"` // 是否设置ipv4
Ip6Exists bool `json:"ip6Exists"` // 是否存在IP6网络
Ip4Exists bool `json:"ip4Exists"` // 是否存在IP4网络
UrlIp6Api string `json:"urlIp6Api"` // 设置IPV6接口获取地址
SpecifyNetworkCard bool `json:"specifyNetworkCard"` // 是否指定网卡
SpecifyNetworkCardName string `json:"specifyNetworkCardName"` // 指定网卡名称
}
// Response 定义对应的结构体
type Response struct {
Response struct {
RecordList []struct {
RecordId int `json:"RecordId"`
} `json:"RecordList"`
} `json:"Response"`
}
// AutoGenerated 定义对应的结构体
type AutoGenerated struct {
Response struct {
RecordCountInfo struct {
SubdomainCount int `json:"SubdomainCount"`
ListCount int `json:"ListCount"`
TotalCount int `json:"TotalCount"`
} `json:"RecordCountInfo"`
RecordList []struct {
RecordID int `json:"RecordId"`
Value string `json:"Value"`
Status string `json:"Status"`
UpdatedOn string `json:"UpdatedOn"`
Name string `json:"Name"`
Line string `json:"Line"`
LineID string `json:"LineId"`
Type string `json:"Type"`
MonitorStatus string `json:"MonitorStatus"`
Remark string `json:"Remark"`
TTL int `json:"TTL"`
Mx int `json:"MX"`
} `json:"RecordList"`
RequestID string `json:"RequestId"`
} `json:"Response"`
}
// DomainConfig 定义对应的结构体
type DomainConfig struct {
Domain struct {
Domain string `json:"Domain"` // 域名
Sub string `json:"Sub"` // 子域名
Sub4 string `json:"Sub4"` // 子域名V4
Sub6 string `json:"Sub6"` // 子域名V6
Remark string `json:"Remark"` // 备注
Type string `json:"Type"` // 解析类型
}
Login struct {
Id string `json:"Id"` // 账号
Key string `json:"Key"` // 密钥
}
Option struct {
Delete bool `json:"delete"` // 是否删除已存在的记录再添加
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/liumou_site/ddns-go.git
git@gitee.com:liumou_site/ddns-go.git
liumou_site
ddns-go
ddns-go
8d00b3eedc50

搜索帮助