Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTooManyRequests is returned when the CB state is half open and the requests count is over the cb requestThreshold ErrTooManyRequests = errors.New("too many requests") // ErrOpenState is returned when the CB state is open ErrOpenState = errors.New("circuit breaker is open") )
Functions ¶
This section is empty.
Types ¶
type CircuitBreaker ¶
type CircuitBreaker struct {
// contains filtered or unexported fields
}
func NewCircuitBreaker ¶
func NewCircuitBreaker(cfg Config) *CircuitBreaker
func (*CircuitBreaker) Execute ¶
func (cb *CircuitBreaker) Execute(req func() (interface{}, error)) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.
