package lightCore type Config struct { App AppConfigModel `mapstructure:"app" yaml:"app"` Server ServerConfigModel `mapstructure:"server" yaml:"server"` Database DatabaseConfigModel `mapstructure:"database" yaml:"database"` Redis RedisConfigModel `mapstructure:"redis" yaml:"redis"` Admin AdminConfigModel `mapstructure:"admin" yaml:"admin"` } func (t *Config) IsRelease() bool { return t.Server.RunMode == "release" } type AppConfigModel struct { JwtSecret string `mapstructure:"jwt_secret" yaml:"jwt_secret"` AliOssSign string `mapstructure:"ali_oss_sign" yaml:"ali_oss_sign"` } type AdminConfigModel struct { JwtSecret string `mapstructure:"jwt_secret" yaml:"jwt_secret"` JwtExpires int `mapstructure:"jwt_expires" yaml:"jwt_expires"` ApiPath string `mapstructure:"api_path" yaml:"api_path"` } type ServerConfigModel struct { RunMode string `mapstructure:"run_mode" yaml:"run_mode"` HttpPort int `mapstructure:"http_port" yaml:"http_port"` ReadTimeout int `mapstructure:"read_timeout" yaml:"read_timeout"` WriteTimeout int `mapstructure:"write_timeout" yaml:"write_timeout"` } type DatabaseConfigModel struct { Type string `mapstructure:"type" yaml:"type"` User string `mapstructure:"user" yaml:"user"` Password string `mapstructure:"password" yaml:"password"` Host string `mapstructure:"host" yaml:"host"` Name string `mapstructure:"name" yaml:"name"` Charset string `mapstructure:"charset" yaml:"charset"` TablePrefix string `mapstructure:"table_prefix" yaml:"table_prefix"` LogLevel string `mapstructure:"log_level" yaml:"log_level"` } type RedisConfigModel struct { Host string `mapstructure:"host" yaml:"host"` Password string `mapstructure:"password" yaml:"password"` MaxIdle string `mapstructure:"max_idle" yaml:"max_idle"` MaxActive string `mapstructure:"max_active" yaml:"max_active"` IdleTimeout string `mapstructure:"idle_timeout" yaml:"idle_timeout"` }