Documentation
¶
Overview ¶
Package doctor answers "would lich start on this machine, and why not". It walks the same boot the app walks — config dir, log file, the pinned listener, the workspace database, the browser, the providers — and reports each step with a verdict and how long it took.
It is a command line because the failure it diagnoses is a window that never opened: there is no Settings › Help behind a window that is not there. It needs no TTY and no running instance, and it exits non-zero when a check that would stop a launch fails, so it works as a smoke test in a script.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Browser ¶
Browser resolves the window lich launches, and says which rung produced it — the bundled one or a LICH_SHELL pin.
func Failed ¶
Failed reports whether any check would stop a launch, which is what the exit code carries to a script.
func Instance ¶
Instance returns the lich recorded in the runtime file and whether it still answers. A recorded instance that does not is itself a finding, so the caller gets both halves rather than a single boolean.
func OnPath ¶
OnPath lists every distinct binary of a provider on $PATH with its version. The id comes from Detect, so the one error OnPath has (an unknown id) cannot happen here.
func Providers ¶
Providers lists the harnesses on PATH. A detection that fails outright is reported as none found: both callers treat "no provider" as their finding, and neither has anywhere to put the error.
Types ¶
type Doctor ¶
type Doctor struct {
// contains filtered or unexported fields
}
Doctor runs the checks. Every probe that reaches the machine is a field, so a test decides what this machine has without touching PATH, the port or the database.
type Status ¶
type Status string
Status is one check's verdict.
const ( // OK: this step of a launch would succeed. OK Status = "ok" // Warn: lich starts, but something it offers will not work. Warn Status = "warn" // Fail: a launch stops here. Any Fail exits non-zero. Fail Status = "fail" // Skip: the check could not run without disturbing the instance already // running — reported rather than guessed at. Skip Status = "skip" )