Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TextFormat 文本格式 TextFormat = LogFormat("text") // JSONFormat json格式 JSONFormat = LogFormat("json") )
View Source
const ( // ToFile 保存到文件 ToFile = LogTo("file") // ToStdout 打印到标准输出 ToStdout = LogTo("stdout") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type Log ¶
type Log struct { Level string `toml:"level" env:"LOG_LEVEL"` Format LogFormat `toml:"format" env:"LOG_FORMAT"` To LogTo `toml:"to" env:"LOG_TO"` PathDir string `toml:"path_dir" env:"LOG_PATH_DIR"` }
用于配置全局Logger对象
type MySQL ¶
type MySQL struct { Host string `toml:"host" env:"D_MYSQL_HOST"` Port string `toml:"port" env:"D_MYSQL_PORT"` UserName string `toml:"username" env:"D_MYSQL_USERNAME"` Password string `toml:"password" env:"D_MYSQL_PASSWORD"` Database string `toml:"database" env:"D_MYSQL_DATABASE"` MaxOpenConn int `toml:"max_open_conn" env:"D_MYSQL_MAX_OPEN_CONN"` MaxIdleConn int `toml:"max_idle_conn" env:"D_MYSQL_MAX_IDLE_CONN"` MaxLifeTime int `toml:"max_life_time" env:"D_MYSQL_MAX_LIFE_TIME"` MaxIdleTime int `toml:"max_idle_time" env:"D_MYSQL_MAX_idle_TIME"` // contains filtered or unexported fields }
用于配置全局MySql对象
Click to show internal directories.
Click to hide internal directories.