time

package
v2.3.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExponentialDelayWithJitter added in v2.3.4

func ExponentialDelayWithJitter(ctx context.Context, attempt uint, baseDelay, maxDelay time.Duration) error

ExponentialDelayWithJitter is an exponential backoff strategy with jitter for retries. It calculates delay based on the attempt number, adds jitter, and sleeps for that duration, capped at maxDelay.

func LinearDelay added in v2.3.4

func LinearDelay(ctx context.Context, attempt uint, increment, maxDelay time.Duration) error

LinearDelay implements a linear backoff strategy for retries. It calculates delay based on the attempt number and sleeps for that duration, capped at maxDelay.

func NanoToTime

func NanoToTime(nsec int64) time.Time

NanoToTime converts an int64 nanoseconds to a time

func SubNano

func SubNano(x int64, y int64) time.Duration

SubNano returns the difference between two nanoseconds

Types

This section is empty.

Jump to

Keyboard shortcuts

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