retry

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, cfg Config, fn func() error) error

Do executes fn with exponential backoff retry

func DoWithResult

func DoWithResult[T any](ctx context.Context, cfg Config, fn func() (T, error)) (T, error)

DoWithResult executes fn with retry and returns result

Types

type Config

type Config struct {
	MaxAttempts int
	InitialWait time.Duration
	MaxWait     time.Duration
	Multiplier  float64
}

Config defines retry behavior

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns sensible defaults

Jump to

Keyboard shortcuts

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