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 `json:"debug" mapstructure:"debug" yaml:"debug"`
ProjectName string `json:"project_name" mapstructure:"project_name" yaml:"project_name"`
GinAddr string `json:"gin_addr" mapstructure:"gin_addr" yaml:"gin_addr"`
Domain string `json:"domain" mapstructure:"domain" yaml:"domain"`
StaticDir string `json:"static_dir" mapstructure:"static_dir" yaml:"static_dir"`
GinLogPath string `json:"gin_log_path" mapstructure:"gin_log_path" yaml:"gin_log_path"`
RunLogPath string `json:"run_log_path" mapstructure:"run_log_path" yaml:"run_log_path"`
Tz string `json:"tz" mapstructure:"tz" yaml:"tz"`
JwtKey string `json:"jwt_key" mapstructure:"jwt_key" yaml:"jwt_key"`
Database Database `json:"database" mapstructure:"database" yaml:"database"`
Telegram Telegram `json:"telegram" mapstructure:"telegram" yaml:"telegram"`
Weixin Weixin `json:"weixin" mapstructure:"weixin" yaml:"weixin"`
Cors []string `json:"cors" mapstructure:"cors" yaml:"cors"`
}
viper要用到mapstructure/yaml
type Database ¶
type Database struct {
Type string `json:"type" mapstructure:"type" yaml:"type" env:"DB_TYPE"`
SqlitePath string `json:"sqlite_path" mapstructure:"sqlite_path" yaml:"sqlite_path" env:"SQLITE_PATH"`
MysqlHost string `json:"mysql_host" mapstructure:"mysql_host" yaml:"mysql_host" env:"MYSQL_HOST"`
MysqlPort string `json:"mysql_port" mapstructure:"mysql_port" yaml:"mysql_port" env:"MYSQL_PORT"`
MysqlDbname string `json:"mysql_dbname" mapstructure:"mysql_dbname" yaml:"mysql_dbname" env:"MYSQL_DBNAME"`
MysqlUsername string `json:"mysql_username" mapstructure:"mysql_username" yaml:"mysql_username" env:"MYSQL_USERNAME"`
MysqlPassword string `json:"mysql_password" mapstructure:"mysql_password" yaml:"mysql_password" env:"MYSQL_PASSWORD"`
}
type Weixin ¶
type Weixin struct {
XcxAppid string `json:"xcx_appid" mapstructure:"xcx_appid" yaml:"xcx_appid"`
XcxSecret string `json:"xcx_secret" mapstructure:"xcx_secret" yaml:"xcx_secret"`
GzhAppid string `json:"gzh_appid" mapstructure:"gzh_appid" yaml:"gzh_appid"`
GzhSecret string `json:"gzh_secret" mapstructure:"gzh_secret" yaml:"gzh_secret"`
}
Click to show internal directories.
Click to hide internal directories.