Versions in this module Expand all Collapse all v1 v1.0.1 Sep 22, 2023 Changes in this version + const CircuitBreakerFailure + const CircuitBreakerModeA + const CircuitBreakerModeB + const CircuitBreakerModeC + const CircuitBreakerModeD + const CircuitBreakerSuccess + const CircuitBreakerUnknown + var ErrorCircuitBreakerTripped = errors.New("circuit breaker tripped") + var Now = time.Now + func New(ctx activity.InitContext) (activity.Activity, error) + type Activity struct + func (a *Activity) Eval(ctx activity.Context) (done bool, err error) + func (a *Activity) Metadata() *activity.Metadata + type Context struct + func (c *Context) AddRecord(weight float64, now time.Time) + func (c *Context) Probability(now time.Time) float64 + func (c *Context) Trip(now time.Time, timeout time.Duration) + type Input struct + Operation string + func (r *Input) FromMap(values map[string]interface{}) error + func (r *Input) ToMap() map[string]interface{} + type Output struct + Tripped bool + func (o *Output) FromMap(values map[string]interface{}) error + func (o *Output) ToMap() map[string]interface{} + type Record struct + Stamp time.Time + Weight float64 + type Settings struct + Mode string + Period int + Threshold int + Timeout int