A second chance.
Not ten more.
One retry for an eligible, replay-safe call. Diagnosis and budgets decide whether it can help.
Budgeted retriesA little care for every API call
Budgeted retries, dependency breakers, and adaptive timeouts for Go's outbound calls. One module for HTTP and unary gRPC, with an Engine for other calls. No extra service to run.
A replay-safe read is sent.
An eligible read gets at most one extra attempt, only when the diagnosis and retry budgets allow it.
Responding to failure automatically, within safe limits. Curo adapts how your service calls an API, not the API itself. It can't fix an upstream outage. It can help your service handle one.
01 / The approach
Not just when to stop. When to try again, how long to wait, and when to let traffic return.
One retry for an eligible, replay-safe call. Diagnosis and budgets decide whether it can help.
Budgeted retriesReads get a time limit learned from recent latency, within bounds you set. Earlier caller deadlines always win.
Adaptive timeoutsOnce a dependency is diagnosed as down, calls fail fast. After each cooldown, a probe tests recovery, and traffic returns when one succeeds.
Dependency breakersDeterministic rules, not AI. Decisions come with evidence and reasons.
02 / Start small
Wrap your existing transport. Curo starts in Observe, showing its decisions without changing request behavior.
go get github.com/raj1kshtz/curo@v1.0.1transport, err := curo.New(
http.DefaultTransport,
)
if err != nil {
return err
}
client := &http.Client{
Transport: transport,
Timeout: time.Minute,
}
// Review Stats and Report, then:
// transport.SetMode(curo.Enforce)
// Close transport on shutdown.03 / A little clarity
The short version, before
you dive into the docs.
Go developers whose services call APIs, gRPC servers, or databases. Curo wraps outbound calls, not incoming handlers: net/http requests through its transport, and other calls through an Engine. It is not a proxy or a separate service.
HTTP/1.1, HTTPS, and HTTP/2 with no Curo setting, because the transport wraps your base transport, which keeps its own connections, TLS, and protocol negotiation. Unary gRPC calls through the curogrpc package in the same module, which leaves retries to grpc-go. Database queries, cache commands, and other calls that you run through Engine.Do. Not streams or long-lived connections.
No. One github.com/raj1kshtz/curo module includes both packages and requires Go 1.26 or later. Its module graph includes grpc-go and protobuf, even for HTTP-only consumers, but HTTP-only binaries do not compile or link gRPC unless another import needs it. When upgrading from the old standalone adapter, remove its separate module requirement as the gRPC guide explains.
Only in Enforce mode, which you choose with WithMode at startup or SetMode at runtime. Each control still needs its own evidence and safety checks. Observe is the default, and switching back to it stops every action. Off passes requests straight through.
Your clients, the operating mode, and the timeout bounds, which default to 2 and 30 seconds. Keep client timeouts above that ceiling. Every other threshold is fixed. Curo never extends a caller's deadline, and it retries only HTTP reads and the Engine calls you mark ReplaySafe.
Stats counts requests, retries, breaker actions, timeouts, and Curo's own failures. Report shows each dependency's readiness, diagnosis, reasons, evidence, and timeout. Both encode to JSON, so a private debug endpoint can serve them.
In Enforce mode, ErrBreakerOpen means the call was never sent, and ErrTimeout means the dependency may have received it. Match both with errors.Is, checking ErrTimeout before context.DeadlineExceeded, which it also matches. curogrpc returns them as Unavailable and DeadlineExceeded statuses that still match.
A failure inside Curo never fails a call. After three internal failures within a minute, the transport or engine passes every call straight through for the rest of its life. Stats reports this, and WithLogger logs the failures through log/slog.
State belongs to one transport or engine in one process, so replicas learn separately and restarts start cold. Each tracks up to 128 targets, each a scheme, host, port, and method class, and calls beyond them get no actions. Retries and breakers wait for about 30 seconds of steady traffic.
Curo v1.0.1 gives both public packages one stable compatibility promise: breaking API changes require a new major module version. Adaptive tuning may still improve in minor releases. CI tests Linux, macOS, and Windows, under the race detector, on the minimum supported Go version and the two latest releases without duplicate versions, and requires every statement to run. Pin the version you adopt.
Small integration. Thoughtful safeguards.