MCPcopy Index your code
hub / github.com/failsafe-go/failsafe-go

github.com/failsafe-go/failsafe-go @v0.9.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.9.6 ↗ · + Follow
1,500 symbols 6,089 edges 149 files 557 documented · 37% 6 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Failsafe-go

Build Status Go Report Card codecov License Godoc

Failsafe-go is a library for building resilient, fault tolerant Go applications. It works by wrapping functions with one or more resilience policies, which can be combined and composed as needed. Policies include:

Usage

Visit failsafe-go.dev for usage info, docs, and additional resources.

Contributing

Check out the contributing guidelines.

License

© 2023-present Jonathan Halterman and contributors. Released under the MIT license.

Extension points exported contracts — how you extend this code

Resetable (Interface)
(no doc) [13 implementers]
internal/testutil/tester.go
UsageTracker (Interface)
UsageTracker tracks resource usage per user as execution usages for fair execution prioritization. [2 implementers]
priority/usage.go
LevelTracker (Interface)
LevelTracker tracks priority levels for executions, which can be used to prioritize rejections. [2 implementers]
priority/priority.go
Budget (Interface)
Budget restricts concurrent executions as a way of preventing system overload. This type is concurrency safe. [1 implementers]
budget/budget.go
ExecutionStats (Interface)
ExecutionStats for tracking execution results. Implementations are not concurrency safe and must be guarded externally. [1 …
internal/util/stats.go
Executor (Interface)
Executor handles failures according to configured policies. See [With] for details on creating an Executor. R is the re
executor.go
ExecutionInfo (Interface)
ExecutionInfo contains execution info.
execution.go
ExecutionResult (Interface)
ExecutionResult provides the result of an asynchronous execution.
result.go

Core symbols most depended-on inside this repo

Run
called by 329
executor.go
Build
called by 288
hedgepolicy/hedge.go
Get
called by 146
executor.go
Add
called by 78
internal/util/ewma.go
Context
called by 59
executor.go
IsOpen
called by 49
circuitbreaker/circuitbreaker.go
IsClosed
called by 48
circuitbreaker/circuitbreaker.go
Reset
called by 44
internal/util/util.go

Shape

Method 835
Function 467
Struct 117
Interface 64
TypeAlias 12
FuncType 5

Languages

Go100%

Modules by API surface

adaptivelimiter/adaptivelimiter.go79 symbols
circuitbreaker/circuitbreaker.go63 symbols
retrypolicy/retry.go60 symbols
execution.go60 symbols
executor.go43 symbols
ratelimiter/ratelimiter.go39 symbols
adaptivethrottler/adaptivethrottler.go39 symbols
circuitbreaker/circuitbreakerbuilder.go36 symbols
internal/policytesting/executor.go32 symbols
internal/testutil/fixtures.go31 symbols
internal/util/stats.go30 symbols
internal/util/util.go28 symbols

For agents

$ claude mcp add failsafe-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact