Directories
¶
| Path | Synopsis |
|---|---|
|
Package bulkhead provides a Bulkhead pattern implementation that limits concurrent executions using a semaphore.
|
Package bulkhead provides a Bulkhead pattern implementation that limits concurrent executions using a semaphore. |
|
Package circuitbreaker implements the Circuit Breaker resilience pattern.
|
Package circuitbreaker implements the Circuit Breaker resilience pattern. |
|
middleware
Package middleware provides HTTP and gRPC middleware for the circuit breaker.
|
Package middleware provides HTTP and gRPC middleware for the circuit breaker. |
|
Package clock provides a mockable time source for deterministic testing.
|
Package clock provides a mockable time source for deterministic testing. |
|
Package concurrency provides an adaptive concurrency limiter in the style of Netflix's concurrency-limits library.
|
Package concurrency provides an adaptive concurrency limiter in the style of Netflix's concurrency-limits library. |
|
Package debounce provides lightweight debounce and throttle primitives for coalescing rapid function invocations, in the spirit of Lodash's debounce and throttle.
|
Package debounce provides lightweight debounce and throttle primitives for coalescing rapid function invocations, in the spirit of Lodash's debounce and throttle. |
|
Package eventstream provides a generic, zero-dependency publish/subscribe broker for streaming resilience events (rate-limit decisions, breaker transitions, bulkhead rejections, or any consumer-defined payload) to many independent subscribers.
|
Package eventstream provides a generic, zero-dependency publish/subscribe broker for streaming resilience events (rate-limit decisions, breaker transitions, bulkhead rejections, or any consumer-defined payload) to many independent subscribers. |
|
examples
|
|
|
debounce
command
Package main demonstrates the debounce package's two coalescing primitives:
|
Package main demonstrates the debounce package's two coalescing primitives: |
|
distributed
command
Package main demonstrates distributed rate limiting backed by Redis.
|
Package main demonstrates distributed rate limiting backed by Redis. |
|
grpc-server
command
Package main demonstrates gRPC server interceptors for rate limiting and circuit breaking.
|
Package main demonstrates gRPC server interceptors for rate limiting and circuit breaking. |
|
http-server
command
Package main demonstrates how to use the resilience library with an HTTP server.
|
Package main demonstrates how to use the resilience library with an HTTP server. |
|
pipeline
command
Package main demonstrates the pipeline builder pattern for composing resilience policies.
|
Package main demonstrates the pipeline builder pattern for composing resilience policies. |
|
resilience-stack
command
Package main demonstrates the resilience.Builder facade — a single fluent builder that composes a rate limiter, bulkhead, timeout, circuit breaker, retry (with an optional retry budget) and an outer fallback into one stack.
|
Package main demonstrates the resilience.Builder facade — a single fluent builder that composes a rate limiter, bulkhead, timeout, circuit breaker, retry (with an optional retry budget) and an outer fallback into one stack. |
|
tiered
command
Package main demonstrates hierarchical (tiered) rate limiting with ratelimit/tiered.
|
Package main demonstrates hierarchical (tiered) rate limiting with ratelimit/tiered. |
|
Package fallback provides fallback and hedge request patterns for resilience.
|
Package fallback provides fallback and hedge request patterns for resilience. |
|
internal
|
|
|
atomicx
Package atomicx provides atomic operations for types not covered by sync/atomic.
|
Package atomicx provides atomic operations for types not covered by sync/atomic. |
|
clock
Package clock is a backward-compatibility shim that re-exports the public clock package.
|
Package clock is a backward-compatibility shim that re-exports the public clock package. |
|
simulation
Package simulation provides a deterministic, zero-dependency simulation harness for the resilience primitives in this repository (circuit breaker, retry, bulkhead, ...).
|
Package simulation provides a deterministic, zero-dependency simulation harness for the resilience primitives in this repository (circuit breaker, retry, bulkhead, ...). |
|
testutil
Package testutil provides testing helpers for the resilience library.
|
Package testutil provides testing helpers for the resilience library. |
|
Package loadshed implements a CoDel-style (Controlled Delay) admission controller with priority-aware shedding.
|
Package loadshed implements a CoDel-style (Controlled Delay) admission controller with priority-aware shedding. |
|
Package logging provides a zero-dependency structured-logging bridge that turns a stdlib *slog.Logger into the hook types the resilience core already understands.
|
Package logging provides a zero-dependency structured-logging bridge that turns a stdlib *slog.Logger into the hook types the resilience core already understands. |
|
Package metric defines the zero-dependency Recorder interface that the core resilience packages use to emit observability signals (rate-limit decisions, circuit-breaker state, bulkhead saturation).
|
Package metric defines the zero-dependency Recorder interface that the core resilience packages use to emit observability signals (rate-limit decisions, circuit-breaker state, bulkhead saturation). |
|
prometheus
Package prometheus provides a Prometheus adapter implementing the metric.Recorder interface.
|
Package prometheus provides a Prometheus adapter implementing the metric.Recorder interface. |
|
observability
|
|
|
otel
Package otel provides a real, configured OpenTelemetry tracing path for the resilience library and its demo server.
|
Package otel provides a real, configured OpenTelemetry tracing path for the resilience library and its demo server. |
|
otelhttp
Package otelhttp provides a minimal, dependency-light net/http tracing middleware built directly on the OpenTelemetry trace and propagation APIs.
|
Package otelhttp provides a minimal, dependency-light net/http tracing middleware built directly on the OpenTelemetry trace and propagation APIs. |
|
Package pipeline provides a resilience pipeline builder that chains multiple resilience patterns in a fixed, production-correct order.
|
Package pipeline provides a resilience pipeline builder that chains multiple resilience patterns in a fixed, production-correct order. |
|
Package ratelimit provides rate limiting algorithms for Go applications.
|
Package ratelimit provides rate limiting algorithms for Go applications. |
|
adaptive
Package adaptive implements an adaptive rate limiter that adjusts its limit based on system health signals (CPU utilization, error rate, P99 latency).
|
Package adaptive implements an adaptive rate limiter that adjusts its limit based on system health signals (CPU utilization, error rate, P99 latency). |
|
composite
Package composite implements a composite rate limiter that combines multiple Limiter implementations using AND or OR logic.
|
Package composite implements a composite rate limiter that combines multiple Limiter implementations using AND or OR logic. |
|
fixedwindow
Package fixedwindow implements the Fixed Window Counter rate limiting algorithm.
|
Package fixedwindow implements the Fixed Window Counter rate limiting algorithm. |
|
gcra
Package gcra implements the Generic Cell Rate Algorithm (GCRA) for rate limiting.
|
Package gcra implements the Generic Cell Rate Algorithm (GCRA) for rate limiting. |
|
internal/shardmap
Package shardmap provides a generic, sharded concurrent map used by the local rate-limit algorithms to hold per-key state.
|
Package shardmap provides a generic, sharded concurrent map used by the local rate-limit algorithms to hold per-key state. |
|
leakybucket
Package leakybucket implements the Leaky Bucket rate limiting algorithm.
|
Package leakybucket implements the Leaky Bucket rate limiting algorithm. |
|
middleware
Package middleware provides HTTP and gRPC middleware for rate limiting.
|
Package middleware provides HTTP and gRPC middleware for rate limiting. |
|
proptest
Package proptest holds property-based tests (using pgregory.net/rapid) that assert algebraic invariants over the concrete rate limiters under any random schedule of operations and deterministic clock advances.
|
Package proptest holds property-based tests (using pgregory.net/rapid) that assert algebraic invariants over the concrete rate limiters under any random schedule of operations and deterministic clock advances. |
|
ratelimitctx
Package ratelimitctx provides typed context helpers for propagating a request's cost (weight) and priority through call chains, so that middleware, pipeline stages, load shedders, and handlers can agree on those values without threading extra parameters (ENHANCEMENTS §2.8).
|
Package ratelimitctx provides typed context helpers for propagating a request's cost (weight) and priority through call chains, so that middleware, pipeline stages, load shedders, and handlers can agree on those values without threading extra parameters (ENHANCEMENTS §2.8). |
|
slidingwindow
Package slidingwindow implements two sliding window rate limiting variants.
|
Package slidingwindow implements two sliding window rate limiting variants. |
|
store
Package store provides in-memory and Redis-backed store implementations.
|
Package store provides in-memory and Redis-backed store implementations. |
|
tiered
Package tiered implements hierarchical (tiered) rate limiting: a request is checked against an ordered chain of tiers and is allowed only if every tier in the chain allows it.
|
Package tiered implements hierarchical (tiered) rate limiting: a request is checked against an ordered chain of tiers and is allowed only if every tier in the chain allows it. |
|
tokenbucket
Package tokenbucket implements the Token Bucket rate limiting algorithm.
|
Package tokenbucket implements the Token Bucket rate limiting algorithm. |
|
Package resilience provides a single, discoverable fluent builder that composes the toolkit's resilience primitives — rate limiting, circuit breaking, retry (with an optional shared budget), bulkhead concurrency limiting, timeout, and fallback — into one executable Stack.
|
Package resilience provides a single, discoverable fluent builder that composes the toolkit's resilience primitives — rate limiting, circuit breaking, retry (with an optional shared budget), bulkhead concurrency limiting, timeout, and fallback — into one executable Stack. |
|
Package resiliencex provides generic, value-returning adapters over the core resilience primitives in this module (circuit breaker, retry, and bulkhead).
|
Package resiliencex provides generic, value-returning adapters over the core resilience primitives in this module (circuit breaker, retry, and bulkhead). |
|
Package retry provides a configurable retry mechanism with pluggable backoff strategies.
|
Package retry provides a configurable retry mechanism with pluggable backoff strategies. |
|
backoff
Package backoff provides composable backoff strategies for use with the retry package.
|
Package backoff provides composable backoff strategies for use with the retry package. |
|
Package timeout provides a simple timeout wrapper for functions.
|
Package timeout provides a simple timeout wrapper for functions. |
Click to show internal directories.
Click to hide internal directories.