Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTooManyRequests = errors.New("too many requests") 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(name string, st Settings) *CircuitBreaker
func (*CircuitBreaker) Counts ¶
func (cb *CircuitBreaker) Counts() Counts
func (*CircuitBreaker) Execute ¶
func (cb *CircuitBreaker) Execute(req func() error, opts ...Option) (err error)
func (*CircuitBreaker) Name ¶
func (cb *CircuitBreaker) Name() string
func (*CircuitBreaker) State ¶
func (cb *CircuitBreaker) State() State
type TwoStepCircuitBreaker ¶
type TwoStepCircuitBreaker struct {
// contains filtered or unexported fields
}
func NewTwoStepCircuitBreaker ¶
func NewTwoStepCircuitBreaker(name string, st Settings) *TwoStepCircuitBreaker
func (*TwoStepCircuitBreaker) Allow ¶
func (cbTs *TwoStepCircuitBreaker) Allow() (done func(success bool), err error)
func (*TwoStepCircuitBreaker) Counts ¶
func (cbTs *TwoStepCircuitBreaker) Counts() Counts
func (*TwoStepCircuitBreaker) Name ¶
func (cbTs *TwoStepCircuitBreaker) Name() string
func (*TwoStepCircuitBreaker) State ¶
func (cbTs *TwoStepCircuitBreaker) State() State
Click to show internal directories.
Click to hide internal directories.