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
Click to show internal directories.
Click to hide internal directories.