Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶
Types ¶
type AsyncTask ¶
type AsyncTask struct {
RedisAddr string `mapstructure:"redisAddr"`
RedisPort int64 `mapstructure:"redisPort"`
RedisDb int `mapstructure:"redisDb"`
RedisMaxReTries int `mapstructure:"redisMaxRetries"`
RedisPassword string `mapstructure:"redisPassword"`
RedisPoolSize int `mapstructure:"redisPoolSize"`
TaskPoolSize int `mapstructure:"taskPoolSize"`
}
type Config ¶
type Config struct {
APP APP `mapstructure:"app"`
Mysql Mysql `mapstructure:"mysql"`
Redis Redis `mapstructure:"redis"`
Log Log `mapstructure:"log"`
HTTPServer HTTPServer `mapstructure:"httpServer"`
FilePath FilePath `mapstructure:"filePath"`
Minio Minio `mapstructure:"minio"`
Captcha Captcha `mapstructure:"captcha"`
RpcXServer RpcXServer `mapstructure:"rpcServer"`
K8s K8s `mapstructure:"k8s"`
AsyncTask AsyncTask `mapstructure:"asyncTask"`
}
type HTTPServer ¶
type Log ¶
type Log struct {
Level string `mapstructure:"level"`
Stdout bool `mapstructure:"stdout"`
LogRate bool `mapstructure:"logRate"`
LogRateConf LogRateConf `mapstructure:"logRateConf"`
}
type LogRateConf ¶
type Mysql ¶
type Mysql struct {
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
Addr string `mapstructure:"addr"`
Port int `mapstructure:"port"`
Database string `mapstructure:"database"`
MaxOpenConn int `mapstructure:"maxOpenConn"`
MaxIdleConn int `mapstructure:"maxIdleConn"`
ConnMaxLifeTime time.Duration `mapstructure:"connMaxLifeTime"`
LogLevel int `mapstructure:"logLevel"`
Charset string `mapstructure:"charset"`
Collation string `mapstructure:"collation"`
}
type Options ¶
type Options struct {
ComponentConfig Config
WebServer *core.WebServer
RpcXServer *core.RpcXServer
Db *gorm.DB
Redis *redis.Client
Minio *minio.Client
K8sClient *k8s.ClientSets
AsyncTask *async_task.AsyncTask
}
type RpcXServer ¶
type RpcXServer struct {
ServerName string `mapstructure:"serverName"`
Address string `mapstructure:"address"`
Port int `mapstructure:"port"`
ReadTimeout int64 `mapstructure:"readTimeout"` // 单位秒
WriteTimeout int64 `mapstructure:"writeTimeout"` // 单位秒
EtcdNodes []string `mapstructure:"etcdNodes"`
EtcdBasePath string `mapstructure:"etcdBasePath"`
EtcdUpdateInterval int64 `mapstructure:"etcdUpdateInterval"` // 单位秒
EtcdExpired int64 `mapstructure:"etcdExpired"` // 单位秒
PondPoolMaxWorkers int `mapstructure:"pondPoolMaxWorkers"` // 协程配置,和pondPoolMaxCapacity必须都有值才生效
PondPoolMaxCapacity int `mapstructure:"pondPoolMaxCapacity"`
CertFile string `mapstructure:"certFile"`
KeyFile string `mapstructure:"keyFile"`
}
Click to show internal directories.
Click to hide internal directories.