health

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPass      = "pass"
	StatusFail      = "fail"
	StatusRecovered = "recovered"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckFunc

type CheckFunc func() CheckResult

CheckFunc is a function that performs a health check.

type CheckResult

type CheckResult struct {
	Name    string
	Status  string
	Message string
	Fix     string
}

CheckResult holds the outcome of a single health check.

func CheckClaudeProcess

func CheckClaudeProcess(tc *tmux.Client, sessionName string) CheckResult

CheckClaudeProcess checks that a claude child process is alive under the tmux pane.

func CheckClaudeSession

func CheckClaudeSession(uuid string) CheckResult

CheckClaudeSession verifies that a Claude session UUID exists in ~/.claude/.

func CheckEnvVars

func CheckEnvVars(required []string) CheckResult

CheckEnvVars checks that all required environment variables are set. Returns fail with list of missing vars if any are absent.

func CheckPathEntries

func CheckPathEntries(required []string) CheckResult

CheckPathEntries checks that all required binaries are available in PATH. An empty list always passes.

func CheckTmuxSession

func CheckTmuxSession(client *tmux.Client, name string) CheckResult

CheckTmuxSession verifies that a tmux session with the given name exists.

func CheckWorkdir

func CheckWorkdir(workdir string) CheckResult

CheckWorkdir verifies that the given directory exists and is a directory.

func (CheckResult) Passed

func (r CheckResult) Passed() bool

Passed returns true if the check passed or was recovered.

type Results

type Results struct {
	Items []CheckResult
}

Results holds the outcomes of all executed checks.

func (Results) AllPassed

func (r Results) AllPassed() bool

AllPassed returns true if every check passed or recovered.

func (Results) Failures

func (r Results) Failures() []CheckResult

Failures returns only the failed check results.

type Runner

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

Runner executes a sequence of health checks.

func NewRunner

func NewRunner() *Runner

NewRunner creates a new Runner with no checks registered.

func (*Runner) Add

func (r *Runner) Add(fn CheckFunc)

Add registers a check function to be run.

func (*Runner) Run

func (r *Runner) Run() Results

Run executes all registered checks in order, stopping on the first failure.

Jump to

Keyboard shortcuts

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