Documentation ¶
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 function enclosed.
type Setting ¶
type Setting struct { // The threshold for the circuit to open. FailureThreshold uint // The timeout after which we set the state to half-open and allow a retry. RetryTimeout time.Duration // The threshold of the retry successes which returns the state to open. RetrySuccessThreshold uint // The threshold of how many retry executions are allowed when the status is half-open. MaxRetryExecutionThreshold uint }
Setting definition.
Click to show internal directories.
Click to hide internal directories.