retry

package
v0.0.0-...-e322e64 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	MaxRetries: 3,
	WaitTime:   1 * time.Second,
}

DefaultConfig is the default configuration for the retry package

Functions

func Run

func Run(fn RetryFunc, cfg Config) error

Run runs the given RetryFunc with the given Config

Types

type Config

type Config struct {

	// MaxRetries is the maximum number of retries
	MaxRetries int

	// WaitTime is the time to wait between retries
	WaitTime time.Duration

	// Logger is the logger to use
	Logger func(log string)
}

Config is the configuration for the retry package

type RetryFunc

type RetryFunc func() error

RetryFunc is a function that will be retried if it returns an error

Jump to

Keyboard shortcuts

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