Help us shape the future of Go! Take the 2026 Go Developer Survey

retries

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 6 Imported by: 4

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