Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // 全局请求超时 Timeout int64 // RequestTimeout int64 // ReadTimeout int64 // WriteTimeout int64 Database *DatabseConfig `json:"mysql,omitempty" mapstructure:"database"` Redis *RedisConfig `json:"redis,omitempty"` Logger *LoggerConfig `json:"logger,omitempty"` }
func InitGlobalConfig ¶
type DatabseConfig ¶
type DatabseConfig struct { Dsn string `json:"dsn,omitempty"` Driver string `json:"driver,omitempty"` Loc string `json:"loc,omitempty"` ParseTime string `json:"parse_time,omitempty"` Timeout int64 `json:"timeout,omitempty"` MaxOpen int `json:"max_open,omitempty"` MaxIdle int `json:"max_idle,omitempty"` ConnMaxLifeSecond int `json:"conn_max_life_second,omitempty"` }
func GetDatabase ¶
func GetDatabase() *DatabseConfig
type LoggerConfig ¶
func GetLoggerConfig ¶
func GetLoggerConfig() *LoggerConfig
type RedisConfig ¶
func GetRedis ¶
func GetRedis() *RedisConfig
Click to show internal directories.
Click to hide internal directories.