retry

package
v1.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackOff

func BackOff(n int, o *Option) time.Duration

func Fixed

func Fixed(_ int, o *Option) time.Duration

func Random

func Random(_ int, o *Option) time.Duration

Types

type Func

type Func func(int, *Option) time.Duration

func Group

func Group(fs ...Func) Func

type Opt

type Opt func(*Option)

func Context

func Context(ctx context.Context) Opt

func Debug

func Debug(debug bool) Opt

func Delay

func Delay(delay time.Duration) Opt

func Function

func Function(f Func) Opt

func MaxDelay

func MaxDelay(maxDelay time.Duration) Opt

func MaxJitter

func MaxJitter(maxJitter time.Duration) Opt

func Retry

func Retry(retry int) Opt

func Timer

func Timer(timer func(d time.Duration) <-chan time.Time) Opt

type Option

type Option struct {
	// contains filtered or unexported fields
}

func NewOption

func NewOption(opts ...Opt) *Option

func (*Option) Retry

func (o *Option) Retry(fn func() error) error

Jump to

Keyboard shortcuts

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