Versions in this module Expand all Collapse all v1 v1.0.0 Aug 8, 2021 Changes in this version + var ErrBucketSize = errors.New("bucket duration and size must divide equally") + func Execute(c Command, b *CircuitBreaker) interface + type CircuitBreaker struct + func NewBreaker(errors, volume int64, timeout time.Duration, w *Window) *CircuitBreaker + func (b *CircuitBreaker) Allow() bool + func (b *CircuitBreaker) Close() + func (b *CircuitBreaker) Error(err error) + func (b *CircuitBreaker) ForceClose() + func (b *CircuitBreaker) ForceOpen() + func (b *CircuitBreaker) IsClosed() bool + func (b *CircuitBreaker) IsForced() bool + func (b *CircuitBreaker) IsOpen() bool + func (b *CircuitBreaker) MarkFailure() + func (b *CircuitBreaker) MarkShortCircuited() + func (b *CircuitBreaker) MarkSuccess() + func (b *CircuitBreaker) Open() + type Command interface + Fallback func() interface{} + Run func() (interface{}, error) + type Window struct + func NewWindow(n int, d time.Duration) (*Window, error) + func (w *Window) Errors() int64 + func (w *Window) Failures() (failures int64) + func (w *Window) Reset() + func (w *Window) ShortCircuited() (shortcircuit int64) + func (w *Window) Successes() (successes int64) + func (w *Window) Total() (total int64)