Documentation ¶
Index ¶
Constants ¶
View Source
const ( // k8s的容器环境变量 K8S_ENV_TEST = "test" K8S_ENV_PRE = "pre" K8S_ENV_PROD = "production" RUN_ENV = "run_env" )
View Source
const ( // 分页参数 PAGE_MIN = 1 PAGE_SIZE_MAX = 20 )
View Source
const ( INVALID_PARAMS = "invalidParams" SUCCESS = "success" FAIL = "failed" NONE_LOGIN = "nonLogin" )
View Source
const ( TIMEOUT_MILLISECOND_50 = 50 * time.Millisecond TIMEOUT_MILLISECOND_60 = 60 * time.Millisecond TIMEOUT_MILLISECOND_100 = 100 * time.Millisecond TIMEOUT_MILLISECOND_120 = 120 * time.Millisecond TIMEOUT_MILLISECOND_140 = 140 * time.Millisecond TIMEOUT_MILLISECOND_150 = 150 * time.Millisecond TIMEOUT_MILLISECOND_200 = 200 * time.Millisecond TIMEOUT_MILLISECOND_280 = 280 * time.Millisecond TIMEOUT_MILLISECOND_290 = 290 * time.Millisecond TIMEOUT_MILLISECOND_300 = 300 * time.Millisecond TIMEOUT_MILLISECOND_450 = 450 * time.Millisecond TIMEOUT_MILLISECOND_1000 = time.Second TIMEOUT_MILLISECOND_3000 = 3 * time.Second TIMEOUT_MILLISECOND_5000 = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppConfiguration ¶
type AppConfiguration struct { // app名称 AppName string `yaml:"appName"` // listen addr Listen string `yaml:"listen"` LogConf LogConf `yaml:"log"` DbConf DbConf `yaml:"db"` KvDbConf KvDbConf `yaml:"kvdb"` }
var AppConfig *AppConfiguration
func ParseConfig ¶
func ParseConfig(file string) *AppConfiguration
type DbConf ¶
type DbConf struct { DefaultMasterDsn string `yaml:"defaultMasterDsn"` DefaultMasterIdle int `yaml:"defaultMasterIdle"` DefaultMasterOpen int `yaml:"defaultMasterOpen"` DefaultSlaveDsn string `yaml:"defaultSlaveDsn"` DefaultSlaveIdle int `yaml:"defaultSlaveIdle"` DefaultSlaveOpen int `yaml:"defaultSlaveOpen"` }
type DefaultJson ¶
type DefaultJson struct { Status string `json:"status"` Message string `json:"message"` Data interface{} `json:"data"` }
DefaultJson是返回的默认json格式
Click to show internal directories.
Click to hide internal directories.