retry

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do added in v0.5.0

func Do(cfg Config, fn func() error) error

func DoCtx added in v0.5.0

func DoCtx(h ctxpkg.Handle, cfg Config, fn func(ctxpkg.Handle) error) error

func Sleep

func Sleep(cfg Config, attempt int)

Types

type Config

type Config struct {
	MaxAttempts  int
	InitialDelay int
	Strategy     Strategy
}

func Attempts

func Attempts(cfg Config, maxAttempts int) Config

func Delay

func Delay(cfg Config, delayMs int) Config

func Exponential added in v0.5.0

func Exponential(cfg Config) Config

func Linear

func Linear(cfg Config) Config

func New

func New() Config

type Strategy added in v0.5.0

type Strategy string
const (
	StrategyLinear      Strategy = "linear"
	StrategyExponential Strategy = "exponential"
)

func (Strategy) String added in v0.5.0

func (e Strategy) String() string

Jump to

Keyboard shortcuts

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