doctor

package
v0.12.36 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusOK      = "ok"
	StatusWarning = "warning"
	StatusError   = "error"
)

Status constants for health check results.

Variables

This section is empty.

Functions

func PIDAlive

func PIDAlive(pid int) bool

PIDAlive checks if a process is alive using signal 0.

func WorstStatus

func WorstStatus(a, b string) string

WorstStatus returns the more severe of two statuses.

Types

type CheckResult

type CheckResult struct {
	Name    string      `json:"name"`
	Status  string      `json:"status"`
	Message string      `json:"message"`
	Details interface{} `json:"details,omitempty"`
	Fix     string      `json:"fix,omitempty"`
}

CheckResult is a single health check outcome.

type Deps

type Deps interface {
	PIDTracker() *goprocess.FilePIDTracker
	ProcessManager() *goprocess.ProcessManager
	ProxyManager() *proxy.ProxyManager
	ScriptRegistry() *script.Registry
	SessionRegistry() *session.SessionRegistry
	AlertStore() *alert.ProcessAlertStore
	StartupLog() *startuplog.StartupLogStore
	StartedAt() time.Time
	ClientCount() int64
	Version() string
}

Deps abstracts the daemon capabilities needed by health checks.

type Report

type Report struct {
	Status string        `json:"status"`
	Checks []CheckResult `json:"checks"`
}

Report is the aggregate of all health checks.

func Run

func Run(ctx context.Context, projectPath string, d Deps) *Report

Run runs all health checks concurrently and returns a structured report.

Jump to

Keyboard shortcuts

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