retryexecutor

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionHandlerFunc

type ExecutionHandlerFunc func() (shouldRetry bool, err error)

type RetryExecutor

type RetryExecutor struct {
	// The context
	Context context.Context

	// The amount of retries to perform.
	MaxRetries int

	// Number of milliseconds to sleep between retries.
	RetriesIntervalMilliSecs int

	// Message to display when retrying.
	ErrorMessage string

	// Prefix to print at the beginning of each log.
	LogMsgPrefix string

	// ExecutionHandler is the operation to run with retries.
	ExecutionHandler ExecutionHandlerFunc
}

func (*RetryExecutor) Execute

func (runner *RetryExecutor) Execute() error

func (*RetryExecutor) LogRetry

func (runner *RetryExecutor) LogRetry(attemptNumber int, err error)

type TimeoutError

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

Error of this type will be returned if the executor reaches timeout and no other error is returned by the execution handler.

func (TimeoutError) Error

func (retryErr TimeoutError) Error() string

Jump to

Keyboard shortcuts

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