Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = &MyConfig{ Name: "APP", LogFile: "./logs/run.log", EnableDebug: true, EnableRedis: false, EnableMySQL: false, }
Config instance with default value in global use
Functions ¶
This section is empty.
Types ¶
type MyConfig ¶
type MyConfig struct { Name string LogFile string // SSL file path EnableDebug bool EnableRedis bool EnableMySQL bool RedisConfig RedisConfig MySQLConfig MySQLConfig ServerConfig ServerConfig }
MyConfig export
type MySQLConfig ¶
type MySQLConfig struct { Host string `default:"127.0.0.1"` Port string `default:"3306"` Name string Username string Password string // connection pool MaxOpenConns int MaxIdleConns int // seconds of maximum amount a connection may be reused ConnMaxLifetime int Charset string // seconds Timeout int }
MySQLConfig class
type RedisConfig ¶
type RedisConfig struct { Host string `default:"127.0.0.1"` Port string `default:"6379"` MaxIdle int MaxActive int Password string Db int `default:"0"` // timeout millisecond ConnectionTimeout int `default:"30000"` // timeout millisecond ReadTimeout int `default:"5000"` // timeout millisecond WriteTimeout int `default:"5000"` // timeout second IdleTimeout int `default:"300"` }
RedisConfig struct
Click to show internal directories.
Click to hide internal directories.