Versions in this module Expand all Collapse all v0 v0.6.0 Sep 25, 2026 Changes in this version + var ErrNoUsableEndpoint = errors.New("failnext: no usable endpoint") + var ErrUnknownEndpoint = errors.New("failnext: unknown endpoint") + func WithFailoverAllowed(ctx context.Context) context.Context + func WithFailoverDenied(ctx context.Context) context.Context + func WithPreferredEndpoint(ctx context.Context, id EndpointID) context.Context + type AttemptError struct + Endpoint EndpointID + Err error + type Config struct + AdditionalTriggerStatusCodes []int + Base http.RoundTripper + Cooldown CooldownConfig + Eligible func(EndpointID) bool + Endpoints []Endpoint + OnEvent func(context.Context, Event) + PermissionPolicy func(*http.Request) Permission + type CooldownConfig struct + Disabled bool + Duration time.Duration + Threshold int + type Endpoint struct + ID EndpointID + URL string + type EndpointID string + type Event struct + Attempt int + Endpoint EndpointID + Err error + Kind EventKind + StatusCode int + type EventKind uint8 + const EventAttempt + const EventCooldownSkip + const EventReplayError + const EventResult + type FailoverError struct + Attempts []AttemptError + func (e *FailoverError) Error() string + func (e *FailoverError) Unwrap() error + type Permission uint8 + const PermissionAllow + const PermissionDefer + const PermissionDeny + type Transport struct + func New(cfg Config) (*Transport, error) + func (t *Transport) CloseIdleConnections() + func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)