retry

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Retry

type Retry struct {
	Iteration int
	StartTime time.Time
	NextRetry time.Time
	// contains filtered or unexported fields
}

func MustRetry

func MustRetry(settings Settings) *Retry

func MustRetryWithTime

func MustRetryWithTime(t time.Time, settings Settings) *Retry

func NewRetry

func NewRetry(settings Settings) (*Retry, error)

func NewRetryWithTime

func NewRetryWithTime(t time.Time, settings Settings) (*Retry, error)

func (*Retry) Do

func (rm *Retry) Do(do func() error, onRetry func(error)) error

func (*Retry) Next

func (rm *Retry) Next()

func (*Retry) ShouldContinue

func (rm *Retry) ShouldContinue() bool

type Settings

type Settings struct {
	InitialBackoff time.Duration
	Multiplier     int
	MaxBackoff     time.Duration
	MaxRetries     int
}

func DefaultSettings

func DefaultSettings() Settings

func (Settings) Verify

func (s Settings) Verify() error

Jump to

Keyboard shortcuts

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