Documentation ¶
Index ¶
- func ConfigAppGet(key string) interface{}
- func ConfigAppGetInt(key string, defaultConfig int) int
- func ConfigAppGetString(key string, defaultConfig string) string
- func ConfigCodeGetMessage(code int) string
- func ConfigCodeInit()
- func ConfigEnvGet() string
- func ConfigEnvIsBeta() bool
- func ConfigEnvIsDev() bool
- func Init(configURL string) (err error)
- type APM
- type App
- type Code
- type ConfigCodeList
- type DBBase
- type DBPool
- type Log
- type Mysql
- type Redis
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigAppGet ¶
func ConfigAppGet(key string) interface{}
func ConfigAppGetInt ¶
func ConfigAppGetString ¶
func ConfigCodeGetMessage ¶
func ConfigCodeInit ¶
func ConfigCodeInit()
func ConfigEnvGet ¶
func ConfigEnvGet() string
func ConfigEnvIsBeta ¶
func ConfigEnvIsBeta() bool
func ConfigEnvIsDev ¶
func ConfigEnvIsDev() bool
Types ¶
type ConfigCodeList ¶
type DBBase ¶
type DBBase struct { Host string `mapstructure:"host" json:"host" yaml:"host"` Port int `mapstructure:"port" json:"port" yaml:"port"` User string `mapstructure:"user" json:"user" yaml:"user"` Password string `mapstructure:"password" json:"password" yaml:"password"` DBName string `json:"-"` Prefix string `json:"-"` }
type DBPool ¶
type DBPool struct { PoolMinCap int `mapstructure:"pool-min-cap" json:"poolMinCap" yaml:"pool-min-cap"` PoolExCap int `mapstructure:"pool-ex-cap" json:"poolExCap" yaml:"pool-ex-cap"` PoolMaxCap int `mapstructure:"pool-max-cap" json:"pool-max-cap" yaml:"pool-max-cap"` PoolIdleTimeout int `mapstructure:"pool-idle-timeout" json:"poolIdleTimeout" yaml:"pool-idle-timeout"` PoolWaitCount int64 `mapstructure:"pool-wait-count" json:"poolWaitCount" yaml:"pool-wait-count"` PoolWaitTimeout int `mapstructure:"pool-wai-timeout" json:"poolWaitTimeout" yaml:"pool-wai-timeout"` }
type Log ¶
type Log struct { Enabled bool `mapstructure:"enabled" json:"enabled" yaml:"enabled"` OutPut string `mapstructure:"out-put" json:"outPut" yaml:"out-put"` Debug bool `mapstructure:"debug" json:"debug" yaml:"debug"` Key string `mapstructure:"key" json:"key" yaml:"key"` Level logrus.Level `mapstructure:"level" json:"level" yaml:"level"` Redis struct { Host string Port int } App struct { AppName string `mapstructure:"app-name" json:"appName" yaml:"app-name"` AppID string `mapstructure:"app-id" json:"appID" yaml:"app-id"` AppVersion string `mapstructure:"app-version" json:"appVersion" yaml:"app-version"` AppKey string `mapstructure:"app-key" json:"appKey" yaml:"app-key"` Channel string `mapstructure:"channel" json:"channel" yaml:"channel"` SubOrgKey string `mapstructure:"sub-org-key" json:"subOrgKey" yaml:"sub-org-key"` Language string `mapstructure:"language" json:"language" yaml:"language"` } `mapstructure:"app" json:"app" yaml:"app"` }
type Mysql ¶
type Mysql struct { Enabled bool `mapstructure:"enabled" json:"enabled" yaml:"enabled"` DBName string `mapstructure:"dbname" json:"dbName" yaml:"dbname"` Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` Pool DBPool `mapstructure:"pool" json:"pool" yaml:"pool"` Write DBBase `mapstructure:"write" json:"write" yaml:"write"` Reads []DBBase `mapstructure:"reads" json:"reads" yaml:"reads"` }
type Server ¶
type Server struct { App App `mapstructure:"app" json:"app" yaml:"app"` Code Code `mapstructure:"code" json:"code" yaml:"code"` Redis Redis `mapstructure:"redis" json:"redis" yaml:"redis"` Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"` Log Log `mapstructure:"log" json:"log" yaml:"log"` sync.RWMutex }
func GlobalConfig ¶
func GlobalConfig() *Server
Click to show internal directories.
Click to hide internal directories.