retry

package
v1.9.21 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 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 added in v1.9.10

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

Do 指数退避

func (*Retry) New added in v1.9.10

func (*Retry) New() *Retry

New 实例化:重试器

func (*Retry) SetCtx added in v1.9.10

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

SetCtx 设置上下文

func (*Retry) SetFn added in v1.9.10

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

SetFn 设置重试方法

func (*Retry) SetSleep added in v1.9.10

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

SetSleep 设置重试间隔

func (*Retry) WithContext added in v1.9.10

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

WithContext 带上下文的重试

func (*Retry) WithContextAndJitter added in v1.9.10

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