retry

package
v1.66.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APP struct {
	Retry Retry
}

Functions

This section is empty.

Types

type AttrContext

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

func Context

func Context(ctx context.Context) AttrContext

func (AttrContext) Register

func (my AttrContext) Register(retry *Retry)

type AttrFn

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

func Fn

func Fn(fn func() error) AttrFn

func (AttrFn) Register

func (my AttrFn) Register(retry *Retry)

type AttrSleep

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

func Sleep

func Sleep(sleep time.Duration) AttrSleep

func (AttrSleep) Register

func (my AttrSleep) Register(retry *Retry)

type Attributer

type Attributer interface{ Register(retry *Retry) }

type Retry

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

func NewRetry added in v1.66.4

func NewRetry(attrs ...Attributer) *Retry

func (*Retry) Do

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

Do 指数退避

func (*Retry) New

func (*Retry) New(attrs ...Attributer) *Retry

func (*Retry) Set

func (my *Retry) Set(attrs ...Attributer) *Retry

func (*Retry) Simple

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

Simple 线性重试

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