retry

package
v0.0.0-...-3ca17b7 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxRetries = 2

Variables

This section is empty.

Functions

func Do

func Do(fn func() error, opts Option) error

Do retries the function until it returns nil or the max retries is reached. It returns the last error if the max retries is reached.

NOTE: default max retries is 2.

Types

type Option

type Option struct {
	// contains filtered or unexported fields
}

func WithMaxRetries

func WithMaxRetries(maxRetries int) Option

Jump to

Keyboard shortcuts

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