Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Debug 开关
Debug bool `json:"debug" toml:"debug"` // debug开关
// 指标采集开关
EnableMetric bool `json:"enableMetric" toml:"enableMetric"` // 指标采集开关
// 链路追踪开关
EnableTrace bool `json:"enableTrace" toml:"enableTrace"` // 链路开关
// 失败重试次数
RetryCount int `json:"retryCount" toml:"retryCount"` // 重试次数
// 失败重试的间隔时间
RetryWaitTime time.Duration `json:"retryWaitTime" toml:"retryWaitTime"` // 重试间隔时间
// 失败重试的最贱等待时间
RetryMaxWaitTime time.Duration `json:"retryMaxWaitTime" toml:"retryMaxWaitTime"` // 重试最大间隔时间
// 目标服务地址
Addr string `json:"addr" toml:"addr"` // 目标地址
// 请求超时时间
Timeout time.Duration `json:"timeout" toml:"timeout" `
// 收到响应以后是否立即关闭连接
CloseConnection bool `json:"closeConnection" toml:"closeConnection" `
// 慢日志阈值
SlowThreshold time.Duration `json:"slowThreshold" toml:"slowThreshold"` // slowlog 时间阈
// 访问日志开关
EnableAccessLog bool `json:"enableAccessLog" toml:"enableAccessLog"`
// 熔断降级
EnableSentinel bool `json:"enableSentinel" toml:"enableSentinel"`
// 重试
RetryCondition resty.RetryConditionFunc `json:"-" toml:"-"`
// 配置名称
Name string `json:"name"`
// contains filtered or unexported fields
}
Config options
func (*Config) MustSingleton ¶ added in v0.11.0
MustSingleton panics when error found.
Click to show internal directories.
Click to hide internal directories.