Documentation ¶
Index ¶
- func Breaker(opts ...Option) wrapper.CallWrapper
- type CommandConfig
- type Option
- func ConfigureCommand(name string, config CommandConfig) Option
- func DefaultErrorPercentThreshold(errorPercentThreshold int) Option
- func DefaultMaxConcurrentRequests(maxConcurrentRequests int) Option
- func DefaultRequestVolumeThreshold(requestVolumeThreshold int) Option
- func DefaultSleepWindow(sleepWindow int) Option
- func DefaultTimeout(timeout int) Option
- func KeyFunc(keyFunc func(request *http.Request) string) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Breaker ¶
func Breaker(opts ...Option) wrapper.CallWrapper
Types ¶
type CommandConfig ¶
type CommandConfig struct { Timeout int `json:"timeout"` // how long to wait for command to complete, in milliseconds, default 1000 MaxConcurrentRequests int `json:"max_concurrent_requests"` // how many commands of the same type can run at the same time, default 10 RequestVolumeThreshold int `json:"request_volume_threshold"` // the minimum number of requests needed before a circuit can be tripped due to health, default 20 SleepWindow int `json:"sleep_window"` // how long, in milliseconds, to wait after a circuit opens before testing for recovery, default 5000 ErrorPercentThreshold int `json:"error_percent_threshold"` // causes circuits to open once the rolling measure of errors exceeds this percent of requests, default 50 }
type Option ¶
type Option func(*Options)
func ConfigureCommand ¶
func ConfigureCommand(name string, config CommandConfig) Option
func DefaultSleepWindow ¶
func DefaultTimeout ¶
Click to show internal directories.
Click to hide internal directories.