startup

package
v0.11.2 Latest Latest
Warning

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

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

Documentation

Overview

Package startup retries the check a module makes of an external service while the service starts: a database or a storage that comes up a moment after the instance, as happens in a rolling deploy, does not stop the start.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(ctx context.Context, log *slog.Logger, what string, budget time.Duration, try func(context.Context) error, permanent func(error) bool) error

Retry runs try until it succeeds, fails with an error permanent reports, the parent context ends, or budget runs out. The first attempt always runs; no new attempt starts once budget has passed since the first one, so a zero budget is a single attempt. Each attempt bounds itself; Retry does not cut a running attempt short. Failed attempts that are retried are logged at warn level.

Types

This section is empty.

Jump to

Keyboard shortcuts

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