health

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 8 Imported by: 0 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 health provides system health checks for Prism. Checks cover library path accessibility, download client connectivity, and indexer reachability.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckResult

type CheckResult struct {
	Name    string `json:"name"`
	Status  Status `json:"status"`
	Message string `json:"message"`
}

CheckResult describes the outcome of a single health check.

type Report

type Report struct {
	// Status is the worst status across all checks.
	Status Status        `json:"status"`
	Checks []CheckResult `json:"checks"`
}

Report is the aggregated result of all health checks.

type Service

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

Service runs health checks against the system's subsystems.

func NewService

func NewService(
	libSvc *library.Service,
	dlSvc *downloader.Service,
	idxSvc *indexer.Service,
	logger *slog.Logger,
) *Service

NewService creates a new health Service.

func (*Service) Check

func (s *Service) Check(ctx context.Context) Report

Check runs all health checks and returns an aggregated report.

type Status

type Status string

Status represents the health state of a single check or the overall system.

const (
	StatusHealthy   Status = "healthy"
	StatusDegraded  Status = "degraded"
	StatusUnhealthy Status = "unhealthy"
)

Jump to

Keyboard shortcuts

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