retries

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

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 deprecated

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

Deprecated: use return types from non-*AndWait methods

type Option deprecated

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

Deprecated: use return types from non-*AndWait methods

func OnPoll deprecated

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

Deprecated: use return types from non-*AndWait methods

func Timeout deprecated

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

Deprecated: use return types from non-*AndWait methods

type WaitFn

type WaitFn func() *Err

Jump to

Keyboard shortcuts

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