Documentation
¶
Index ¶
- type ConfigEntity
- func (c *ConfigEntity) Get(key string, defaultValue ...interface{}) interface{}
- func (c *ConfigEntity) GetBool(key string, defaultValue ...bool) bool
- func (c *ConfigEntity) GetConfig() *viper.Viper
- func (c *ConfigEntity) GetDuration(key string, defaultValue ...time.Duration) time.Duration
- func (c *ConfigEntity) GetFloat64(key string, defaultValue ...float64) float64
- func (c *ConfigEntity) GetInt(key string, defaultValue ...int) int
- func (c *ConfigEntity) GetIntSlice(key string, defaultValue ...[]int) []int
- func (c *ConfigEntity) GetString(key string, defaultValue ...string) string
- func (c *ConfigEntity) GetStringMap(key string, defaultValue ...map[string]interface{}) map[string]interface{}
- func (c *ConfigEntity) GetStringMapString(key string, defaultValue ...map[string]string) map[string]string
- func (c *ConfigEntity) GetStringSlice(key string, defaultValue ...[]string) []string
- func (c *ConfigEntity) GetTime(key string, defaultValue ...time.Time) time.Time
- type Local
- type LogConfig
- type LogRotate
- type ModCaptcha
- type ModGormDb
- type ModJwt
- type ModRedis
- type ModSwaConfig
- type ModSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigEntity ¶ added in v0.0.3
type ConfigEntity struct {
// contains filtered or unexported fields
}
ConfigEntity 表示需要全局调用的实体对象
func GetInstance ¶ added in v0.0.3
func GetInstance() *ConfigEntity
GetInstance 返回 ConfigDataEntity 的单例实例
func (*ConfigEntity) Get ¶ added in v0.0.3
func (c *ConfigEntity) Get(key string, defaultValue ...interface{}) interface{}
Get 获取interface{}类型配置
func (*ConfigEntity) GetBool ¶ added in v0.0.3
func (c *ConfigEntity) GetBool(key string, defaultValue ...bool) bool
GetBool 获取bool类型配置
func (*ConfigEntity) GetConfig ¶ added in v0.0.3
func (c *ConfigEntity) GetConfig() *viper.Viper
func (*ConfigEntity) GetDuration ¶ added in v0.0.3
GetDuration 获取time.Duration类型配置
func (*ConfigEntity) GetFloat64 ¶ added in v0.0.3
func (c *ConfigEntity) GetFloat64(key string, defaultValue ...float64) float64
GetFloat64 获取float64类型配置
func (*ConfigEntity) GetInt ¶ added in v0.0.3
func (c *ConfigEntity) GetInt(key string, defaultValue ...int) int
GetInt 获取int类型配置
func (*ConfigEntity) GetIntSlice ¶ added in v0.0.3
func (c *ConfigEntity) GetIntSlice(key string, defaultValue ...[]int) []int
GetIntSlice 获取[]int类型配置
func (*ConfigEntity) GetString ¶ added in v0.0.3
func (c *ConfigEntity) GetString(key string, defaultValue ...string) string
GetString 获取string类型配置
func (*ConfigEntity) GetStringMap ¶ added in v0.0.3
func (c *ConfigEntity) GetStringMap(key string, defaultValue ...map[string]interface{}) map[string]interface{}
GetStringMap 获取map[string]interface{}类型配置
func (*ConfigEntity) GetStringMapString ¶ added in v0.0.3
func (c *ConfigEntity) GetStringMapString(key string, defaultValue ...map[string]string) map[string]string
GetStringMapString 获取map[string]string类型配置
func (*ConfigEntity) GetStringSlice ¶ added in v0.0.3
func (c *ConfigEntity) GetStringSlice(key string, defaultValue ...[]string) []string
GetStringSlice 获取[]string类型配置
type Local ¶
type Local struct {
Path string `mapstructure:"path" json:"path" yaml:"path"`
StorePath string `mapstructure:"storePath" json:"storePath" yaml:"storePath"`
}
func (Local) WeaverMarshal ¶
func (Local) WeaverUnmarshal ¶
type LogConfig ¶
type LogConfig struct {
Level string `mapstructure:"level" json:"level" yaml:"level"`
Pattern string `mapstructure:"pattern" json:"pattern" yaml:"pattern"`
Output string `mapstructure:"output" json:"output" yaml:"output"`
LogRotate LogRotate `mapstructure:"logRotate" json:"logRotate" yaml:"logRotate"`
}
func (LogConfig) WeaverMarshal ¶
func (LogConfig) WeaverUnmarshal ¶
type LogRotate ¶
type LogRotate struct {
Filename string `mapstructure:"filename" json:"filename" yaml:"filename"`
MaxSize int `mapstructure:"maxSize" json:"maxSize" yaml:"maxSize"`
MaxBackups int `mapstructure:"maxBackups" json:"maxBackups" yaml:"maxBackups"`
MaxAge int `mapstructure:"maxAge" json:"maxAge" yaml:"maxAge"`
Compress bool `mapstructure:"compress" json:"compress" yaml:"compress"`
}
type ModCaptcha ¶
type ModCaptcha struct {
KeyLong int `mapstructure:"keyLong" json:"keyLong" yaml:"keyLong"`
ImgWidth int `mapstructure:"imgWidth" json:"imgWidth" yaml:"imgWidth"`
ImgHeight int `mapstructure:"imgHeight" json:"imgHeight" yaml:"imgHeight"`
OpenCaptcha int `mapstructure:"openCaptcha" json:"openCaptcha" yaml:"openCaptcha"`
OpenCaptchaTimeOut int `mapstructure:"openCaptchaTimeout" json:"openCaptchaTimeout" yaml:"openCaptchaTimeout"`
}
func (ModCaptcha) WeaverMarshal ¶
func (ModCaptcha) WeaverMarshal(*codegen.Encoder)
func (ModCaptcha) WeaverUnmarshal ¶
func (ModCaptcha) WeaverUnmarshal(*codegen.Decoder)
type ModGormDb ¶
type ModGormDb struct {
DbType string `mapstructure:"dbType" json:"dbType" yaml:"dbType"`
Ip string `mapstructure:"ip" json:"ip" yaml:"ip"`
Port string `mapstructure:"port" json:"port" yaml:"port"`
Username string `mapstructure:"username" json:"username" yaml:"username"`
Password string `mapstructure:"password" json:"password" yaml:"password"`
Dbname string `mapstructure:"dbName" json:"dbName" yaml:"dbName"`
Config string `mapstructure:"config" json:"config" yaml:"config"`
Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
Singular bool `mapstructure:"singular" json:"singular" yaml:"singular"`
Engine string `mapstructure:"engine" json:"engine" yaml:"engine" default:"InnoDB"`
MaxIdleConns int `mapstructure:"maxIdleConns" json:"maxIdleConns" yaml:"maxIdleConns"`
MaxOpenConns int `mapstructure:"maxOpenConns" json:"maxOpenConns" yaml:"maxOpenConns"`
LogMode string `mapstructure:"logMode" json:"logMode" yaml:"logMode"`
LogZap bool `mapstructure:"logZap" json:"logZap" yaml:"logZap"`
Dsn string
}
func (ModGormDb) WeaverMarshal ¶
func (ModGormDb) WeaverUnmarshal ¶
type ModJwt ¶
type ModJwt struct {
SigningKey string `mapstructure:"signingKey" json:"signingKey" yaml:"signingKey"` // --jwt签名
ExpiresTime string `mapstructure:"expiresTime" json:"expiresTime" yaml:"expiresTime"` // --过期时间
BufferTime string `mapstructure:"bufferTime" json:"bufferTime" yaml:"bufferTime"` // --缓冲时间
Issuer string `mapstructure:"issuer" json:"issuer" yaml:"issuer"` // --签发者
}
func (ModJwt) WeaverMarshal ¶
func (ModJwt) WeaverUnmarshal ¶
type ModRedis ¶
type ModRedis struct {
DB int `mapstructure:"db" json:"db" yaml:"db"`
Addr string `mapstructure:"addr" json:"addr" yaml:"addr"`
Password string `mapstructure:"password" json:"password" yaml:"password"`
}
func (ModRedis) WeaverMarshal ¶
func (ModRedis) WeaverUnmarshal ¶
type ModSwaConfig ¶
type ModSwaConfig struct {
Jwt ModJwt `mapstructure:"jwt" json:"jwt" toml:"jwt"`
Redis ModRedis `mapstructure:"redis" json:"redis" toml:"redis"`
Captcha ModCaptcha `mapstructure:"captcha" json:"captcha" toml:"captcha"`
GormDB ModGormDb `mapstructure:"gormDB" json:"gormDB" toml:"gormDB"`
System ModSystem `mapstructure:"system" json:"system" toml:"system"`
Local Local `mapstructure:"local" json:"local" toml:"local"`
Log LogConfig `mapstructure:"log" json:"log" toml:"log"`
}
func (ModSwaConfig) WeaverMarshal ¶
func (ModSwaConfig) WeaverMarshal(*codegen.Encoder)
func (ModSwaConfig) WeaverUnmarshal ¶
func (ModSwaConfig) WeaverUnmarshal(*codegen.Decoder)
type ModSystem ¶
type ModSystem struct {
Debug bool `mapstructure:"debug" json:"debug" yaml:"debug"`
EnablePProf bool `mapstructure:"enablePProf" json:"enablePProf" yaml:"enablePProf"`
PprofPort string `mapstructure:"pprofPort" json:"pprofPort" yaml:"pprofPort"`
Env string `mapstructure:"env" json:"env" yaml:"env"`
Addr int `mapstructure:"addr" json:"addr" yaml:"addr"`
DbType string `mapstructure:"dbType" json:"dbType" yaml:"dbType"`
OssType string `mapstructure:"ossType" json:"ossType" yaml:"ossType"`
UseMultipoint bool `mapstructure:"useMultipoint" json:"useMultipoint" yaml:"useMultipoint"`
UseRedis bool `mapstructure:"useRedis" json:"useRedis" yaml:"useRedis"`
LimitCountIP int `mapstructure:"ipLimitCount" json:"ipLimitCount" yaml:"ipLimitCount"`
LimitTimeIP int `mapstructure:"ipLimitTime" json:"ipLimitTime" yaml:"ipLimitTime"`
RouterPrefix string `mapstructure:"routerPrefix" json:"routerPrefix" yaml:"routerPrefix"`
ResourceCachingEnabled bool `mapstructure:"resourceCachingEnabled" json:"resourceCachingEnabled" yaml:"resourceCachingEnabled"`
}
func (ModSystem) WeaverMarshal ¶
func (ModSystem) WeaverUnmarshal ¶
Click to show internal directories.
Click to hide internal directories.