代码拉取完成,页面将自动刷新
package conf
type Env string
const (
EnvDev Env = "dev" // 开发环境
EnvProd Env = "prod" // 正式环境
EnvTest Env = "test" // 测试环境
)
type Directories struct {
Static string `mapstructure:"static" json:"static" yaml:"static"`
Doc string `mapstructure:"doc" json:"doc" yaml:"doc"`
}
type AppConfig struct {
// Name string `mapstructure:"name" json:"name" yaml:"name"`
Env Env `mapstructure:"env" json:"env" yaml:"env"`
Host string `mapstructure:"host" json:"host" yaml:"host"`
Port int `mapstructure:"port" json:"port" yaml:"port"`
Directories *Directories `mapstructure:"directories" json:"directories" yaml:"directories"`
// System AppConfig `mapstructure:"system" json:"system" yaml:"system"`
DB DbConfig `mapstructure:"db" json:"db" yaml:"db"`
Zap ZapConfig `mapstructure:"zap" json:"zap" yaml:"zap"`
Cors *CorsConfig `mapstructure:"cors" json:"cors" yaml:"cors"`
JWT *JwtConfig `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
Redis *RedisConfig `mapstructure:"redis" json:"redis" yaml:"redis"`
}
func (c *AppConfig) JwtEnabled() bool {
return c.JWT != nil && c.JWT.Enable
}
func (c *AppConfig) CorsEnabled() bool {
return c.Cors != nil && c.Cors.Enable
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。