Versions in this module Expand all Collapse all v0 v0.0.2 Jun 5, 2022 Changes in this version + var ErrServiceUnavailable = errors.New("circuit breaker is open") + func Do(name string, req func() error) error + func DoWithAcceptable(name string, req func() error, acceptable Acceptable) error + func DoWithFallback(name string, req func() error, fallback func(err error) error) error + func DoWithFallbackAcceptable(name string, req func() error, fallback func(err error) error, ...) error + func NoBreakerFor(name string) + type Acceptable func(err error) bool + type Breaker interface + Allow func() (Promise, error) + Do func(req func() error) error + DoWithAcceptable func(req func() error, acceptable Acceptable) error + DoWithFallback func(req func() error, fallback func(err error) error) error + DoWithFallbackAcceptable func(req func() error, fallback func(err error) error, acceptable Acceptable) error + Name func() string + func GetBreaker(name string) Breaker + func NewBreaker(opts ...Option) Breaker + type Option func(breaker *circuitBreaker) + func WithName(name string) Option + type Promise interface + Accept func() + Reject func(reason string)