Documentation
¶
Overview ¶
Package circuitbreaker provides a circuit breaker pattern implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action func() (interface{}, error)
Action function to execute in circuit breaker.
type CircuitBreaker ¶
CircuitBreaker implementation.
func (*CircuitBreaker) Execute ¶
func (cb *CircuitBreaker) Execute(act Action) (interface{}, error)
Execute the provided action.
type Setting ¶
type Setting struct { // FailureThreshold for the circuit to open. FailureThreshold uint // RetryTimeout after which we set the state to half-open and allow a retry. RetryTimeout time.Duration // RetrySuccessThreshold which returns the state to open. RetrySuccessThreshold uint // MaxRetryExecutionThreshold which defines how many tries are allowed when the status is half-open. MaxRetryExecutionThreshold uint }
Setting definition.
Click to show internal directories.
Click to hide internal directories.