retry

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InterruptedError = errors.New("重试被中断")

Functions

This section is empty.

Types

type Retry

type Retry RetryContext

type RetryContext

type RetryContext struct {
	Do func() error

	Interval time.Duration

	Delay func(ctx *RetryContext) time.Duration

	Interrupter chan struct{}

	MaxRetry int

	Retrievable func(ctx *RetryContext) bool

	Ignorable func(ctx *RetryContext) bool

	Error error

	Retry int
}

func MakeRetry

func MakeRetry(retry Retry) *RetryContext

func (*RetryContext) Todo

func (c *RetryContext) Todo() error

Jump to

Keyboard shortcuts

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