Versions in this module Expand all Collapse all v1 v1.0.0 Apr 3, 2019 Changes in this version + var DefaultErrorPercentThreshold = 50 + var DefaultLogger = NoopLogger + var DefaultMaxConcurrent = 10 + var DefaultSleepWindow = 5000 + var DefaultTimeout = 1000 + var DefaultVolumeThreshold = 20 + var ErrCircuitOpen = CircuitError + var ErrMaxConcurrency = CircuitError + var ErrTimeout = CircuitError + func Configure(cmds map[string]CommandConfig) + func ConfigureCommand(name string, config CommandConfig) + func Do(name string, run runFunc, fallback fallbackFunc) error + func DoC(ctx context.Context, name string, run runFuncC, fallback fallbackFuncC) error + func Flush() + func GetCircuitSettings() map[string]*Settings + func Go(name string, run runFunc, fallback fallbackFunc) chan error + func GoC(ctx context.Context, name string, run runFuncC, fallback fallbackFuncC) chan error + func SetLogger(l logger) + type CircuitBreaker struct + Name string + func GetCircuit(name string) (*CircuitBreaker, bool, error) + func (circuit *CircuitBreaker) AllowRequest() bool + func (circuit *CircuitBreaker) IsOpen() bool + func (circuit *CircuitBreaker) ReportEvent(eventTypes []string, start time.Time, runDuration time.Duration) error + type CircuitError struct + Message string + func (e CircuitError) Error() string + type CommandConfig struct + ErrorPercentThreshold int + MaxConcurrentRequests int + RequestVolumeThreshold int + SleepWindow int + Timeout int + type NoopLogger struct + func (l NoopLogger) Printf(format string, items ...interface{}) + type Settings struct + ErrorPercentThreshold int + MaxConcurrentRequests int + RequestVolumeThreshold uint64 + SleepWindow time.Duration + Timeout time.Duration + type StreamHandler struct + func NewStreamHandler() *StreamHandler + func (sh *StreamHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) + func (sh *StreamHandler) Start() + func (sh *StreamHandler) Stop()