health

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package health provides the two health endpoints every service needs: a liveness check that touches nothing and a database check for uptime monitors.

Keep them separate. A host that restarts the service when the liveness check fails should not see a database outage there: restarting the service does not bring the database back. Point the external monitor at the database check instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB(db *sql.DB, timeout time.Duration) http.Handler

DB answers 200 {"status":"ok"} when "SELECT 1" succeeds within timeout and 503 {"status":"db_unavailable"} otherwise.

func Live

func Live() http.Handler

Live answers 200 {"status":"ok"} without touching any dependency.

Types

This section is empty.

Jump to

Keyboard shortcuts

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