netretry

package
v5.99.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package netretry provides shared retry utilities for transient network errors across Kubernetes client packages (Docker, Helm, etc.).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExponentialDelay

func ExponentialDelay(
	attempt int,
	baseWait, maxWait time.Duration,
) time.Duration

ExponentialDelay returns the delay for the given retry attempt using exponential backoff. Uses the formula: min(baseWait * 2^(attempt-1), maxWait).

func IsRetryable

func IsRetryable(err error) bool

IsRetryable returns true if the error indicates a transient network error that should be retried. This covers HTTP 429 and 5xx status codes and TCP-level errors such as connection resets, timeouts, and unexpected EOF. Callers that need to handle additional domain-specific transient errors (e.g., Copilot auth "fetch failed") should augment this function with a local helper.

Types

This section is empty.

Jump to

Keyboard shortcuts

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