Documentation ¶
Index ¶
- type CompositeCircuitBreaker
- func (c *CompositeCircuitBreaker) CheckResource(res model.Resource) model.CircuitBreakerStatus
- func (c *CompositeCircuitBreaker) Destroy() error
- func (c *CompositeCircuitBreaker) Init(ctx *plugin.InitContext) error
- func (c *CompositeCircuitBreaker) Name() string
- func (c *CompositeCircuitBreaker) OnEvent(event *common.PluginEvent) error
- func (c *CompositeCircuitBreaker) Report(stat *model.ResourceStat) error
- func (c *CompositeCircuitBreaker) Start() error
- func (c *CompositeCircuitBreaker) Type() common.Type
- type CountersBucket
- type HealthCheckersBucket
- type ProtocolInstance
- type ResourceCounters
- func (rc *ResourceCounters) CloseToOpen(breaker string)
- func (rc *ResourceCounters) CurrentActiveRule() *fault_tolerance.CircuitBreakerRule
- func (rc *ResourceCounters) CurrentCircuitBreakerStatus() model.CircuitBreakerStatus
- func (rc *ResourceCounters) HalfOpenToClose()
- func (rc *ResourceCounters) HalfOpenToOpen()
- func (rc *ResourceCounters) OpenToHalfOpen()
- func (rc *ResourceCounters) Report(stat *model.ResourceStat)
- type ResourceHealthChecker
- type RuleContainer
- type TaskExecutor
- func (e *TaskExecutor) AffinityDelayExecute(key string, delay time.Duration, f func())
- func (e *TaskExecutor) AffinityExecute(key string, f func())
- func (e *TaskExecutor) DelayExecute(delay time.Duration, f func())
- func (e *TaskExecutor) Execute(f func())
- func (e *TaskExecutor) IntervalExecute(interval time.Duration, f func())
- func (e *TaskExecutor) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompositeCircuitBreaker ¶
type CompositeCircuitBreaker struct { *plugin.PluginBase // contains filtered or unexported fields }
func (*CompositeCircuitBreaker) CheckResource ¶
func (c *CompositeCircuitBreaker) CheckResource(res model.Resource) model.CircuitBreakerStatus
CheckResource get the resource circuitbreaker status
func (*CompositeCircuitBreaker) Destroy ¶
func (c *CompositeCircuitBreaker) Destroy() error
Destroy 销毁插件,可用于释放资源
func (*CompositeCircuitBreaker) Init ¶
func (c *CompositeCircuitBreaker) Init(ctx *plugin.InitContext) error
Init 初始化插件
func (*CompositeCircuitBreaker) Name ¶
func (c *CompositeCircuitBreaker) Name() string
Name 插件名,一个类型下插件名唯一
func (*CompositeCircuitBreaker) OnEvent ¶
func (c *CompositeCircuitBreaker) OnEvent(event *common.PluginEvent) error
func (*CompositeCircuitBreaker) Report ¶
func (c *CompositeCircuitBreaker) Report(stat *model.ResourceStat) error
Report report resource invoke result stat
func (*CompositeCircuitBreaker) Start ¶
func (c *CompositeCircuitBreaker) Start() error
Start 启动插件,对于需要依赖外部资源,以及启动协程的操作,在Start方法里面做
func (*CompositeCircuitBreaker) Type ¶
func (c *CompositeCircuitBreaker) Type() common.Type
Type 插件类型
type CountersBucket ¶
type CountersBucket struct {
// contains filtered or unexported fields
}
type HealthCheckersBucket ¶
type HealthCheckersBucket struct {
// contains filtered or unexported fields
}
type ProtocolInstance ¶
type ProtocolInstance struct {
// contains filtered or unexported fields
}
type ResourceCounters ¶
type ResourceCounters struct {
// contains filtered or unexported fields
}
ResourceCounters .
func (*ResourceCounters) CloseToOpen ¶
func (rc *ResourceCounters) CloseToOpen(breaker string)
func (*ResourceCounters) CurrentActiveRule ¶
func (rc *ResourceCounters) CurrentActiveRule() *fault_tolerance.CircuitBreakerRule
func (*ResourceCounters) CurrentCircuitBreakerStatus ¶
func (rc *ResourceCounters) CurrentCircuitBreakerStatus() model.CircuitBreakerStatus
func (*ResourceCounters) HalfOpenToClose ¶
func (rc *ResourceCounters) HalfOpenToClose()
func (*ResourceCounters) HalfOpenToOpen ¶
func (rc *ResourceCounters) HalfOpenToOpen()
func (*ResourceCounters) OpenToHalfOpen ¶
func (rc *ResourceCounters) OpenToHalfOpen()
func (*ResourceCounters) Report ¶
func (rc *ResourceCounters) Report(stat *model.ResourceStat)
type ResourceHealthChecker ¶
type ResourceHealthChecker struct {
// contains filtered or unexported fields
}
func NewResourceHealthChecker ¶
func NewResourceHealthChecker(res model.Resource, faultDetector *fault_tolerance.FaultDetector, breaker *CompositeCircuitBreaker) *ResourceHealthChecker
type RuleContainer ¶
type RuleContainer struct {
// contains filtered or unexported fields
}
RuleContainer
type TaskExecutor ¶
type TaskExecutor struct {
// contains filtered or unexported fields
}
func (*TaskExecutor) AffinityDelayExecute ¶
func (e *TaskExecutor) AffinityDelayExecute(key string, delay time.Duration, f func())
func (*TaskExecutor) AffinityExecute ¶
func (e *TaskExecutor) AffinityExecute(key string, f func())
func (*TaskExecutor) DelayExecute ¶
func (e *TaskExecutor) DelayExecute(delay time.Duration, f func())
func (*TaskExecutor) Execute ¶
func (e *TaskExecutor) Execute(f func())
func (*TaskExecutor) IntervalExecute ¶
func (e *TaskExecutor) IntervalExecute(interval time.Duration, f func())
func (*TaskExecutor) Stop ¶
func (e *TaskExecutor) Stop()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.