retry

package module
v0.0.0-...-821f803 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRetryLimited ertryable function must be set limit, Either, timeout or number of retries
	ErrRetryLimited = errors.New("no attempt limited")
)

Functions

This section is empty.

Types

type RetryConfig

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

RetryConfig config of retryable function

func NewRetryConfig

func NewRetryConfig(options ...RetryOptions) *RetryConfig

NewRetryConfig get retry config

func (*RetryConfig) Do

func (rc *RetryConfig) Do(rf RetryFunc) error

Do exec function

type RetryFunc

type RetryFunc func() error

RetryFunc retryable function

type RetryOptions

type RetryOptions func(rc *RetryConfig)

RetryOptions options for retryable function

func WithCounter

func WithCounter(counter int) RetryOptions

WithCounter set attempt num for fretryable function

func WithExpire

func WithExpire(timeout time.Duration) RetryOptions

WithExpire set expire time for fretryable function

func WithInterval

func WithInterval(interval time.Duration) RetryOptions

WithInterval set interval time for fretryable function

Jump to

Keyboard shortcuts

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