Versions in this module Expand all Collapse all v0 v0.3.0 Jun 23, 2026 Changes in this version + var ErrCircuitOpen = errors.New("circuit breaker is open") + type Levee struct + func NewLevee(slo SLO) *Levee + func RestoreState(s *LeveeState) *Levee + func (l *Levee) Call(f func() error) (StateChange, error) + func (l *Levee) Fail(ts time.Time, duration time.Duration) StateChange + func (l *Levee) SaveState() (*LeveeState, error) + func (l *Levee) Start(ts time.Time) (StateChange, error) + func (l *Levee) State() State + func (l *Levee) Success(ts time.Time, duration time.Duration) StateChange + type LeveeState struct + AvgLatency float64 + ConsecFails int + ErrEWMA float64 + ErrLastTSNS int64 + EvalFailures int64 + EvalSuccesses int64 + Goodput float64 + Inflight int64 + InflightLimit float64 + Initialized bool + LastEvalTSNS int64 + LastSuccessTSNS int64 + OpenStreak int + SLO SLO + Samples int64 + StateEnteredAtNS int64 + StateVal uint8 + type SLO struct + SuccessRate float64 + Timeout time.Duration + type State uint8 + const CLOSED + const HALF_OPEN + const OPEN + const THROTTLED + type StateChange struct + State State + Trigger Trigger + type Trigger error v0.2.1 Dec 21, 2025 v0.2.0 Dec 21, 2025