61 lines
1.5 KiB
Go
61 lines
1.5 KiB
Go
package conf
|
|
|
|
// AppConfig
|
|
// 配置文件
|
|
type AppConfig struct {
|
|
// 服务端配置
|
|
Server *ServerConf `json:"server" yaml:"server"`
|
|
// 网页配置
|
|
Web *WebConf `json:"web" yaml:"web"`
|
|
// 任务配置
|
|
Task *TaskConf `json:"task" yaml:"task"`
|
|
// 提供商配置
|
|
Providers *[]ProviderConf `json:"provider" yaml:"provider"`
|
|
// 证书配置
|
|
Certs *[]CertConf `json:"cert" yaml:"cert"`
|
|
}
|
|
|
|
// ServerConf 服务端配置
|
|
type ServerConf struct {
|
|
// 是否启用WEB控制台支持
|
|
Web bool `json:"enable" yaml:"enable"`
|
|
// 监听地址
|
|
Host string `json:"host" yaml:"host"`
|
|
// 监听端口
|
|
Port int `json:"port" yaml:"port"`
|
|
// 通信密钥, DES 加密
|
|
Key string `json:"key" yaml:"key"`
|
|
}
|
|
|
|
// WebConf 网页服务配置
|
|
type WebConf struct {
|
|
Info string `json:"info" yaml:"info"`
|
|
}
|
|
|
|
// TaskConf 定时任务配置
|
|
type TaskConf struct {
|
|
// 启动延迟时间, 单位: 毫秒, 默认: 0
|
|
Delay int `json:"delay" yaml:"delay"`
|
|
// 间隔时间
|
|
Interval int `json:"interval" yaml:"interval"`
|
|
}
|
|
|
|
// ProviderConf 提供商配置
|
|
type ProviderConf struct {
|
|
// 提供商名称
|
|
Name string `json:"name" yaml:"name"`
|
|
// 提供商类型
|
|
Type string `json:"type" yaml:"type"`
|
|
// 提供商配置
|
|
Conf map[string]string `json:"conf" yaml:"conf"`
|
|
}
|
|
|
|
// CertConf 证书配置
|
|
type CertConf struct {
|
|
Name string `json:"name" yaml:"name"`
|
|
Provider string `json:"use" yaml:"provider"`
|
|
Dir string `json:"dir" yaml:"dir"`
|
|
Email string `json:"email" yaml:"email"`
|
|
Host []string `json:"host" yaml:"host"`
|
|
}
|