retry

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2017 License: MIT Imports: 1 Imported by: 1

README

retry

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExponentialBackOff = func(n int, result interface{}) time.Duration {
	return time.Duration(n) * time.Duration(n) * time.Second
}

ExponentialBackOff Interval

Functions

func Retry

func Retry(
	n int,
	interval func(n int, result interface{}) time.Duration,
	fn func() (interface{}, error),
) (interface{}, error)

Retry run your func "fn", if it failed, Retry will retry "n" times with "interval" algorithm

retry.Retry(10, retry.ExponentialBackOff, func() (interface{}, error) {...})

Types

This section is empty.

Jump to

Keyboard shortcuts

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