retry

package
v0.0.0-...-0e7c249 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: MIT Imports: 1 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Forever

func Forever(f Func)

RetryForever keeps trying to call function f until it succeeds.

func ForeverSleep

func ForeverSleep(d time.Duration, f Func)

RetryForeverSleep keeps trying to call function f until it succeeds, and sleeps after each failure.

func Retry

func Retry(n int, f Func) (err error)

Retry retries calling function f n-times. It returns an error if none of the tries succeeds.

func Sleep

func Sleep(n int, d time.Duration, f Func) (err error)

Sleep retries calling function f n-times and sleeps for d after each call. It returns an error if none of the tries succeeds.

Types

type Func

type Func func(int) error

Jump to

Keyboard shortcuts

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