Documentation
¶
Index ¶
- Variables
- func Init(v *viper.Viper) (err error)
- func ServiceName() string
- type AmapServer
- type Bootstrap
- type Commandline
- type Config
- type Consumer
- type GrpcConfig
- type HTTPConfig
- type HttpServer
- type Kv
- type LocalConfig
- type Log
- type LoginUser
- type Nsq
- type OSS
- type Producer
- type Server
- type Trace
- type Transport
Constants ¶
This section is empty.
Variables ¶
View Source
var (
GConfig = &Config{}
)
Functions ¶
func ServiceName ¶
func ServiceName() string
Types ¶
type AmapServer ¶
type AmapServer struct {
Key string `mapstructure:"key"`
}
type Commandline ¶
type Commandline struct {
Graceful bool `mapstructure:"graceful"`
}
type Config ¶
type Config struct {
Env string `mapstructure:"env"`
Commandline Commandline `mapstructure:"commandline"`
Bootstrap Bootstrap `mapstructure:"bootstrap"`
Transport Transport `mapstructure:"transport"`
Log log.ConfigLog `mapstructure:"log"`
Trace Trace `mapstructure:"trace"`
HttpServer HttpServer `mapstructure:"http_server"`
HttpBreaker []map[string]interface{} `mapstructure:"http_breaker"`
ChildServer []map[string]interface{} `mapstructure:"child_server"`
Redis []trace_redis.Redis `mapstructure:"redis"`
Server []Server `mapstructure:"server"`
Nsq Nsq `mapstructure:"nsq"`
Mysql []db.Mysql `mapstructure:"mysql"`
OSS OSS `mapstructure:"oss"`
LoginUser []LoginUser `mapstructure:"login_user"`
LocalConfig LocalConfig `mapstructure:"config"`
AmapServer AmapServer `mapstructure:"amap_server"`
}
type Consumer ¶
type Consumer struct {
Name string `mapstructure:"name"`
Addr string `mapstructure:"addr"`
Lookup []string `mapstructure:"lookup"`
MaxInFlight int32 `mapstructure:"max_inflight"`
DialTimeout int32 `mapstructure:"dial_timeout"`
ReadTimeout int32 `mapstructure:"read_timeout"`
WriteTimeout int32 `mapstructure:"write_timeout"`
}
type GrpcConfig ¶
type GrpcConfig struct {
Addr string `mapstructure:"addr"`
}
type HTTPConfig ¶
type HTTPConfig struct {
Addr string `mapstructure:"addr"`
MaxConns int `mapstructure:"max_conns"`
ReadTimeout float64 `mapstructure:"read_timeout"`
ReadHeaderTimeout float64 `mapstructure:"read_header_timeout"`
WriteTimeout float64 `mapstructure:"write_timeout"`
IdleTimeout float64 `mapstructure:"idle_timeout"`
}
type HttpServer ¶
type LocalConfig ¶
type Log ¶
type Log struct {
LogType string `mapstructure:"type"`
App struct {
FilePath string `mapstructure:"file_path"`
Level string `mapstructure:"level"`
Enable bool `mapstructure:"enable"`
} `mapstructure:"app"`
Access struct {
FilePath string `mapstructure:"file_path"`
Enable bool `mapstructure:"enable"`
} `mapstructure:"access"`
}
type Server ¶
type Server struct {
Name string `mapstructure:"name"`
Url string `mapstructure:"url"`
DiscoveryServiceName string `mapstructure:"discovery_service_name"`
DiscoveryServicePort int `mapstructure:"discovery_service_port"`
DiscoveryTag string `mapstructure:"discovery_tag"`
DiscoveryDC string `mapstructure:"discovery_dc"`
ConnectSidecar string `mapstructure:"connect_sidecar"`
ConnectConsul string `mapstructure:"connect_consul"`
}
type Transport ¶
type Transport struct {
HTTP HTTPConfig `mapstructure:"http"`
InnerHTTP HTTPConfig `mapstructure:"inner_http"`
CmdInnerHTTP HTTPConfig `mapstructure:"cmd_inner_http"`
Grpc GrpcConfig `mapstructure:"grpc"`
}
Click to show internal directories.
Click to hide internal directories.