health

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: May 15, 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 CheckAgentProcess added in v0.1.22

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

CheckAgentProcess verifies that a child process named procName is alive under the tmux pane for sessionName. procName is the value the agent reports via Agent.ProcessName() — "codex" for the codex agent. The check is agent-agnostic; this package has no dependency on any specific agent implementation.

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