retry

package
v0.0.0-...-f9509b0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, retryable RetryableFunc, opts ...Option) error

Do will perform N attempts to execute RetryableFunc.

Types

type Config

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

type Option

type Option func(*Config)

func InitialDelay

func InitialDelay(initialDelay time.Duration) Option

func Logger

func Logger(logger *zap.Logger) Option

func MaxAttempts

func MaxAttempts(maxAttempts int) Option

MaxAttempts is the total number of attempts including the initial attempt.

func MaxJitter

func MaxJitter(maxJitter time.Duration) Option

MaxJitter the maximum amount of time between [0, maxJitter] to add to a delay.

type RetryableFunc

type RetryableFunc func() error

Jump to

Keyboard shortcuts

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