Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Conf = new(Config)
Conf 全局变量 用来保存程序的所有配置信息
Functions ¶
Types ¶
type Config ¶
type Config struct { *AppConfig `mapstructure:"app"` *HttpServer `mapstructure:"http_server"` *LogConfig `mapstructure:"log"` *MySQLConfig `mapstructure:"mysql"` *RedisConfig `mapstructure:"redis"` *MongoConfig `mapstructure:"mongo"` }
type HttpServer ¶
type HttpServer struct {
Port int `mapstructure:"port"`
}
type LogConfig ¶
type LogConfig struct { Level string `mapstructure:"level"` Filename string `mapstructure:"filename"` ErrFilename string `mapstructure:"err_filename"` MaxSize int `mapstructure:"max_size"` MaxAge int `mapstructure:"max_age"` MaxBackups int `mapstructure:"max_backups"` CloseStdout bool `mapstructure:"close_stdout"` }
type MongoConfig ¶
type MySQLConfig ¶
type MySQLConfig struct { Host string `mapstructure:"host"` Port int `mapstructure:"port"` User string `mapstructure:"user"` Password string `mapstructure:"password"` DBName string `mapstructure:"db_name"` MaxOpenConns int `mapstructure:"max_open_conns"` MaxIdleConns int `mapstructure:"max_idle_conns"` }
Click to show internal directories.
Click to hide internal directories.