retry

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: GPL-3.0, LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package retry runs operations with bounded exponential backoff.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, op func() error, retryable func(error) bool,
	attempts int, initial time.Duration) error

Do runs op until it returns nil, retryable returns false, the attempt budget is exhausted, or ctx is done. Backoff doubles each attempt. attempts counts total attempts including the first, so attempts=1 means no retry. Callers bound total wait time with context deadlines.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL