Documentation
¶
Index ¶
- Variables
- func GetHostName(hostName string) string
- func InitCfg()
- type App
- type Auth
- type Casbin
- type ClientProxy
- type Configure
- type Database
- type Etcd
- type Gateway
- type GrafanaProxy
- type HTTPProxy
- type HeartBeat
- type HttpRouter
- type Logger
- type LoggerInfo
- type MultiProxy
- type Pprof
- type ProxyStream
- type Register
- type Server
- type ServerProxy
- type ServerSchema
- type SingleProxy
- type TLS
Constants ¶
This section is empty.
Variables ¶
View Source
var Cfg cfg
Cfg ..
Functions ¶
Types ¶
type Casbin ¶
type Casbin struct {
Enable bool
Debug bool
Model string
AutoLoad bool
AutoLoadInternal int
ResourceFile string
}
Casbin ..
type ClientProxy ¶
type ClientProxy struct {
HttpRouter HttpRouter
SingleProxy SingleProxy
MultiProxy []MultiProxy
}
type Configure ¶
type Configure struct {
Dirs []string `json:"dirs"`
Prefixes []string `json:"prefixes"`
Agent struct {
Port int `json:"port"`
} `json:"agent"`
}
Configure ..
type Database ¶
type Database struct {
Enable bool
// DSN地址: mysql://root:secret@tcp(127.0.0.1:3307)/mysql?timeout=20s&readTimeout=20s
DSN string `json:"dsn" toml:"dsn"`
// Debug开关
Debug bool `json:"debug" toml:"debug"`
// 最大空闲连接数
MaxIdleConns int `json:"maxIdleConns" toml:"maxIdleConns"`
// 最大活动连接数
MaxOpenConns int `json:"maxOpenConns" toml:"maxOpenConns"`
// 连接的最大存活时间
ConnMaxLifetime time.Duration `json:"connMaxLifetime" toml:"connMaxLifetime"`
// 创建连接的错误级别,=panic时,如果创建失败,立即panic
OnDialError string `json:"level" toml:"level"`
// 慢日志阈值
SlowThreshold time.Duration `json:"slowThreshold" toml:"slowThreshold"`
// 拨超时时间
DialTimeout time.Duration `json:"dialTimeout" toml:"dialTimeout"`
// 关闭指标采集
DisableMetric bool `json:"disableMetric" toml:"disableMetric"`
// 关闭链路追踪
DisableTrace bool `json:"disableTrace" toml:"disableTrace"`
}
type Etcd ¶
type Etcd struct {
Enable bool `json:"enable"`
ListenAddr string `json:"listenAddr"`
Endpoints []string `json:"endpoints"`
Namespace string `json:"namespace"`
Timeout time.Duration `json:"timeout"`
TLS TLS `json:"tls"`
}
Etcd ..
type GrafanaProxy ¶
type HTTPProxy ¶
type HTTPProxy struct {
Enable bool
ListenAddr string
Scheme string
Backend string
DisableKeepAlives bool
MaxIdleConns int
MaxIdelPerHost int
Timeout int
}
HTTPProxy ..
type HeartBeat ¶
type HeartBeat struct {
Enable bool `json:"enable"`
Debug bool `json:"debug"`
Addr string `json:"addr"`
Internal time.Duration `json:"internal"`
HostName string `json:"host_name"`
RegionCode string `json:"region_code"`
RegionName string `json:"region_name"`
ZoneCode string `json:"zone_code"`
ZoneName string `json:"zone_name"`
Env string `json:"env"`
}
type HttpRouter ¶
type HttpRouter struct {
GovernConfig string
}
type Logger ¶
type Logger struct {
Biz LoggerInfo
System LoggerInfo
}
type LoggerInfo ¶
type MultiProxy ¶
type MultiProxy struct {
Env string
ZoneCode string
Stream ProxyStream
HTTP HTTPProxy
Etcd Etcd
}
MultiProxy ..
type ProxyStream ¶
type ServerProxy ¶
type ServerProxy struct {
Name string
Stream ProxyStream
HTTPServer ServerSchema
GrpcServer ServerSchema
GovernServer ServerSchema
HeartBeat HeartBeat
Etcd Etcd
Prometheus HTTPProxy
}
ServerProxy ..
type ServerSchema ¶
Click to show internal directories.
Click to hide internal directories.