Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstanceCircuitBreaker ¶
type InstanceCircuitBreaker interface { plugin.Plugin // Stat 进行调用统计,返回当前实例是否需要进行立即熔断 Stat(model.InstanceGauge) (bool, error) // CircuitBreak 进行熔断计算,返回需要进行状态转换的实例ID // 入参包括全量服务实例,以及当前周期的健康探测结果 CircuitBreak(instances []model.Instance) (*Result, error) }
InstanceCircuitBreaker 【扩展点接口】节点熔断
type Proxy ¶
type Proxy struct { InstanceCircuitBreaker // contains filtered or unexported fields }
Proxy .proxy of InstanceCircuitBreaker
func (*Proxy) CircuitBreak ¶
CircuitBreak proxy InstanceCircuitBreaker CircuitBreak
func (*Proxy) SetRealPlugin ¶
SetRealPlugin 设置
type Result ¶
type Result struct { Now time.Time // 需要开启熔断器的实例ID InstancesToOpen model.HashSet // 需要转换成半开状态的实例ID InstancesToHalfOpen model.HashSet // 需要关闭熔断器的实例ID InstancesToClose model.HashSet // 该熔断器在实例进入半开状态后最多允许的请求数 RequestCountAfterHalfOpen int }
Result 熔断结算结果
func NewCircuitBreakerResult ¶
NewCircuitBreakerResult 创建熔断结果对象
Click to show internal directories.
Click to hide internal directories.