acme-mana/src/conf/conf.go
2024-12-27 14:02:58 +08:00

64 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 {
// 监听地址
Host string `json:"host" yaml:"host"`
// 监听端口
Port int `json:"port" yaml:"port"`
// 通信密钥, DES 加密
Key string `json:"key" yaml:"key"`
}
// WebConf 网页服务配置
type WebConf struct {
// 是否启用
Enable bool `json:"enable" yaml:"enable"`
// 监听地址
Host string `json:"host" yaml:"host"`
// 监听端口
Port int `json:"port" yaml:"port"`
}
// 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"`
}