retries

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: Apache-2.0 Imports: 6 Imported by: 4 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backoff

func Backoff(attempt int) time.Duration

func Poll

func Poll[T any](pctx context.Context, timeout time.Duration, fn func() (*T, *Err)) (*T, error)

func Wait

func Wait(pctx context.Context, timeout time.Duration, fn WaitFn) error

Types

type Err

type Err struct {
	Err  error
	Halt bool
}

func Continue

func Continue(err error) *Err

func Continuef

func Continuef(format string, err error, args ...interface{}) *Err

func Continues

func Continues(msg string) *Err

func Halt

func Halt(err error) *Err

type Info

type Info[T any] struct {
	Info    *T
	Timeout time.Duration
}

type Option

type Option[T any] func(*Info[T])

func OnPoll added in v0.2.0

func OnPoll[T any](callback func(*T)) Option[T]

func Timeout

func Timeout[T any](dur time.Duration) Option[T]

type WaitFn

type WaitFn func() *Err

Jump to

Keyboard shortcuts

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