Documentation ¶
Index ¶
Constants ¶
View Source
const ( EnvDev = "dev" EnvTest = "test" EnvPro = "pro" )
View Source
const ( ConfigFileName = "config_origin.yaml" ConfigEncryptFileName = "config.yaml" )
View Source
const BaseKey = "oSTP7QSjwvzQAtbI"
Variables ¶
View Source
var Container *dig.Container
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Project string `yaml:"project"` Env string `yaml:"env"` LogLevel int8 `yaml:"logLevel"` //全局日志等级 Gorm map[string]Gorm `yaml:"gorm"` Redis map[string]redisd.Config `yaml:"redis"` Grpc map[string]Grpc `yaml:"grpc"` Web map[string]*Web `yaml:"web"` Attach interface{} `yaml:"attach"` //附加配置 用户定义 }
Config 配置参数
func (*Config) BindAttachType ¶ added in v1.3.5
func (*Config) PrintProjectInfo ¶
func (conf *Config) PrintProjectInfo()
type ConfigFile ¶
type Gorm ¶
type Gorm struct { Debug bool `yaml:"debug"` LogLvl int `yaml:"logLvl"` SlowThreshold int `yaml:"slowThreshold"` MaxLifetime int `yaml:"maxLifeTime"` MaxOpenConns int `yaml:"maxOpenConns"` MaxIdleConns int `yaml:"maxIdleConns"` Driver GormDriver `json:"driver"` MySQL MySQL `yaml:"mysql"` }
Gorm gorm配置参数
type Grpc ¶
type MySQL ¶
type MySQL struct { Host string `yaml:"host"` Port int `yaml:"port"` User string `yaml:"user"` Password string `yaml:"password"` DBName string `yaml:"dbName"` Parameters string `yaml:"parameters"` Variant MysqlVariant `yaml:"variant"` //mysql变种 }
MySQL mysql配置参数
type MysqlVariant ¶
type MysqlVariant string
type Token ¶
type Token struct { HeaderName string `yaml:"headerName"` // header名 Authorization HeaderType string `yaml:"headerType"` // 验证方式 Bearer CookieName string `yaml:"cookieName"` Key string `yaml:"key"` Alg string `yaml:"alg"` //加密方式 Typ string `yaml:"type"` //鉴权类型 AuthTo string `yaml:"authTo"` //鉴权所属 比如鉴权类型JWT,鉴权用户User JWT:User Expire int64 `yaml:"expire"` //过期时间秒 }
Click to show internal directories.
Click to hide internal directories.