gadgets

package
v0.0.0-...-455f572 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoRetry

func NoRetry(err error) error

func Retry

func Retry(b *Backoff, maxTries int, op func() error) error

func RetryWithLog

func RetryWithLog(ctx context.Context, logger *slog.Logger, operation string, b *Backoff, maxTries int, op func() error) error

func SleepCtx

func SleepCtx(ctx context.Context, duration time.Duration) error

Types

type Backoff

type Backoff struct {
	Start time.Duration
	Max   time.Duration
	Mul   float64
	// contains filtered or unexported fields
}

Backoff computes a retry interval with random jitter, similar to gax.Backoff.

func (*Backoff) Next

func (b *Backoff) Next() time.Duration

Jump to

Keyboard shortcuts

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