health

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package health implements post-deployment health checking. After each deployment, the agent polls the application's health endpoint to verify the new version started successfully before committing state.

A failed health check triggers automatic rollback.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitHealthy

func WaitHealthy(ctx context.Context, checkType, rawURL string, retries int, interval, timeout time.Duration) error

WaitHealthy polls the health endpoint until it is healthy or the retry budget is exhausted.

Parameters:

  • retries: total number of attempts
  • interval: fixed wait between attempts
  • timeout: per-request HTTP timeout

Returns nil on success, error after all retries fail.

Types

type Checker

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

Checker polls an HTTP health endpoint.

func NewChecker

func NewChecker(url string, requestTimeout time.Duration) *Checker

NewChecker creates a Checker for the given URL with per-request timeout.

func (*Checker) Check

func (c *Checker) Check(ctx context.Context) error

Check performs a single health check. It returns nil if the endpoint responds with HTTP 200, or an error describing the failure.

Jump to

Keyboard shortcuts

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