Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Debug bool `toml:"debug"`
LogPath string `toml:"log_path"`
HTTP *HTTP `toml:"http"`
DB *MySQLConfig `toml:"db"`
}
Config 配置
type HTTP ¶
type HTTP struct {
Address string `toml:"address"`
Port int `toml:"port"`
TLSEnable bool `toml:"tls_enable"` // 是否启用tls连接
TLSConfig *HTTPTls `toml:"tls_config"` // 启用tls时必须配置此内容
TLSEncryptEnable bool `toml:"tls_encrypt_enable"` // 是否启用 Let's Encrypt tls
TLSEncryptDomainNames []string `toml:"tls_encrypt_domain_names"` // 启用 Let's Encrypt 时的域名列表
}
HTTP http 件套配置
type MySQLConfig ¶
type MySQLConfig struct {
Debug bool `toml:"debug"` // 是否调试模式
Address string `toml:"address"` // 数据库连接地址
Port int `toml:"port"` // 数据库端口
MaxIdleConns int `toml:"max_idle_conns"` // 连接池最大连接数
MaxOpenConns int `toml:"max_open_conns"` // 默认打开连接数
User string `toml:"user"` // 数据库用户名
Passwd string `toml:"passwd"` // 数据库密码
DbName string `toml:"db_name"` // 数据库名
}
MySQLConfig 数据库配置
Click to show internal directories.
Click to hide internal directories.