Documentation
¶
Overview ¶
Package retry implements the single retry/fallthrough engine shared by the router (credential rotation) and the agents adapter (model rotation).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run tries each candidate in order. The first success wins. A retryable error moves to the next candidate; a terminal error returns immediately. When every candidate fails with a retryable error, a single aggregated "all candidates exhausted" error is returned.
func RunStream ¶
func RunStream(ctx context.Context, candidates []StreamCandidate, w io.Writer, logger *slog.Logger) error
RunStream tries each candidate in order, writing SSE to w. Streaming candidates must only write to w on success paths where the headers are already committed; a retryable failure before any write moves to the next candidate.
Types ¶
type Classifiable ¶
type Classifiable interface {
Retryable() bool
}
Classifiable is implemented by errors that know whether they are retryable.