Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToErrorRateThreshold ¶
ToErrorRateThreshold 转换成熔断错误率阈值
Types ¶
type ConsecutiveCounter ¶
type ConsecutiveCounter struct {
// contains filtered or unexported fields
}
func NewConsecutiveCounter ¶
func NewConsecutiveCounter(name string, opt *Options) *ConsecutiveCounter
func (*ConsecutiveCounter) Report ¶
func (c *ConsecutiveCounter) Report(success bool)
type ErrRateCounter ¶
type ErrRateCounter struct {
// contains filtered or unexported fields
}
func NewErrRateCounter ¶
func NewErrRateCounter(name string, opt *Options) *ErrRateCounter
func (*ErrRateCounter) Report ¶
func (c *ErrRateCounter) Report(success bool)
type Options ¶
type Options struct { Resource model.Resource Condition *fault_tolerance.TriggerCondition StatusHandler StatusChangeHandler Log log.Logger DelayExecutor func(delay time.Duration, f func()) }
Options
type StatusChangeHandler ¶
type StatusChangeHandler interface { // CloseToOpen CloseToOpen(breaker string) // OpenToHalfOpen OpenToHalfOpen() // HalfOpenToClose HalfOpenToClose() // HalfOpenToOpen HalfOpenToOpen() }
StatusChangeHandler
type TriggerCounter ¶
type TriggerCounter interface { // Report . Report(success bool) }
TriggerCounter .
Click to show internal directories.
Click to hide internal directories.