Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCircuitOpen is returned when the circuit breaker is in the Open state. ErrCircuitOpen = errors.New("circuit breaker is open") )
Functions ¶
This section is empty.
Types ¶
type Breaker ¶
type Breaker struct {
// contains filtered or unexported fields
}
Breaker implements a circuit breaker state machine.
type Config ¶
type Config struct {
// FailureThreshold is the number of failures before the circuit opens.
FailureThreshold uint
// ResetTimeout is the duration to wait before transitioning from Open to Half-Open.
ResetTimeout time.Duration
}
Config defines the configuration for the circuit breaker.
Click to show internal directories.
Click to hide internal directories.