retry

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Retry

type Retry struct {
	// contains filtered or unexported fields
}
var RetryApp Retry

func (*Retry) Do

func (my *Retry) Do(attempts int) error

Do 指数退避

func (*Retry) New

func (*Retry) New() *Retry

New 实例化:重试器

func (*Retry) SetCtx

func (my *Retry) SetCtx(ctx context.Context) *Retry

SetCtx 设置上下文

func (*Retry) SetFn

func (my *Retry) SetFn(fn func() error) *Retry

SetFn 设置重试方法

func (*Retry) SetSleep

func (my *Retry) SetSleep(sleep time.Duration) *Retry

SetSleep 设置重试间隔

func (*Retry) WithContext

func (my *Retry) WithContext(attempts int) error

WithContext 带上下文的重试

func (*Retry) WithContextAndJitter

func (my *Retry) WithContextAndJitter(attempts int) error

Jump to

Keyboard shortcuts

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