Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MaxFailures = 5 // 最多失败次数 SleepWindow = 60 * time.Second // 冷却时间 MaxRequests = 2 // 在 HalfOpen 状态下, 如果请求成功次数超过此数值,熔断器关闭(恢复);如果有一个失败,重新进入 Open 状态 )
Functions ¶
This section is empty.
Types ¶
type Breaker ¶ added in v0.6.6
type Breaker struct {
Balancer
}
func BalancerWrapperBreaker ¶ added in v0.6.6
type Lottery ¶ added in v0.5.31
type Lottery struct {
// contains filtered or unexported fields
}
按权重概率抽取,类似抽签。
func NewLottery ¶ added in v0.5.31
Click to show internal directories.
Click to hide internal directories.