Versions in this module Expand all Collapse all v1 v1.0.1 Jun 18, 2026 v1.0.0 Mar 15, 2026 Changes in this version + const K + const MinRPS + const StandardPriorities + var AssertValidPriority = func(p Priority, priorities int) (Priority, error) + var ClampInvalidPriority = func(p Priority, priorities int) (Priority, error) + var ClientSideRejectionError = DefaultClientSideRejectionError + var DefaultAcceptedErrors = func(err error) bool + var DefaultClientSideRejectionError = faults.Unavailable(time.Second) + var DefaultRejectedError = func(err error) bool + var IsRejectedError = DefaultRejectedError + var Now = time.Now + var RejectInvalidPriority = func(p Priority, priorities int) (Priority, error) + func RejectedError(err error) error + func Throttle[T any](ctx context.Context, at *AdaptiveThrottle, defaultPriority Priority, ...) (res T, err error) + func WithAdaptiveThrottle[T any](at *AdaptiveThrottle, priority Priority, throttledFn func() (T, error)) (res T, err error) + func WithPriority(ctx context.Context, priority Priority) context.Context + type AdaptiveThrottle struct + func NewAdaptiveThrottle(priorities int, options ...AdaptiveThrottleOption) *AdaptiveThrottle + func (t *AdaptiveThrottle) Throttle(ctx context.Context, defaultPriority Priority, fn throttledFn, ...) error + type AdaptiveThrottleOption struct + func WithAcceptedErrors(fn func(err error) bool) AdaptiveThrottleOption + func WithAdaptiveThrottleMinimumRate(x float64) AdaptiveThrottleOption + func WithAdaptiveThrottleRatio(k float64) AdaptiveThrottleOption + func WithAdaptiveThrottleWindow(d time.Duration) AdaptiveThrottleOption + func WithClientSideRejectionError(err error) AdaptiveThrottleOption + func WithNow(fn func() time.Time) AdaptiveThrottleOption + func WithPriorityValidator(fn func(p Priority, priorities int) (Priority, error)) AdaptiveThrottleOption + func WithRandomSource(src rand.Source) AdaptiveThrottleOption + func WithRejectedErrorFunc(fn func(error) bool) AdaptiveThrottleOption + type Priority int8 + const High + const Important + const Low + const Medium + func PriorityFromContext(ctx context.Context, defaultPriority Priority) Priority Other modules containing this package github.com/deixis/bulwark/v2