Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Breaker ¶
type Breaker struct {
// contains filtered or unexported fields
}
Breaker implements the circuit breaker pattern
func NewBreaker ¶
NewBreaker creates a new circuit breaker threshold: number of consecutive failures before opening the circuit timeout: duration to wait before transitioning from open to half-open
func (*Breaker) RecordFailure ¶
func (b *Breaker) RecordFailure()
RecordFailure records a failed operation May transition to open state if threshold is exceeded
func (*Breaker) RecordSuccess ¶
func (b *Breaker) RecordSuccess()
RecordSuccess records a successful operation Resets the circuit breaker to closed state
Click to show internal directories.
Click to hide internal directories.