Documentation
¶
Overview ¶
Package doctor runs cheap live health checks against every ketch surface: search/code/docs backends, the configured browser, and the page cache. Probes are read-only — they never write cache entries or mutate config — and each is bounded by a per-probe timeout so a full run stays fast.
Index ¶
Constants ¶
const DefaultTimeout = 3 * time.Second
DefaultTimeout is the per-probe timeout. Probes run concurrently, so the whole run is bounded by roughly one timeout, not the sum.
const SelfHostedSearchTimeout = 10 * time.Second
SelfHostedSearchTimeout is the budget for probes that make the instance run a real federated search rather than answer a single API call. SearXNG spends about three seconds on its own upstream engines, landing right on DefaultTimeout, so the default budget reports healthy instances as timed out.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
Surface string `json:"surface"`
Backend string `json:"backend"`
Status Status `json:"status"`
Detail string `json:"detail,omitempty"`
LatencyMS int64 `json:"latency_ms"`
// Required marks checks that gate the process exit code: the default
// backend of each surface, backends with an API key explicitly configured,
// the configured browser, and the cache. Not part of the JSON schema.
Required bool `json:"-"`
}
Check is one line of the doctor report. The JSON schema is stable: {surface, backend, status, detail, latency_ms}.
type Status ¶
type Status string
Status classifies the outcome of a single doctor check.
const ( // StatusOK means the check passed: configured, reachable, credentials accepted. StatusOK Status = "ok" // StatusNoKey means the backend needs a key/token and none is configured. StatusNoKey Status = "no_key" // StatusUnreachable means the endpoint did not answer (network error, // timeout, or a server-side failure status). StatusUnreachable Status = "unreachable" // StatusMisconfigured means the endpoint answered but rejected the setup // (invalid key, SearXNG JSON format blocked, missing browser binary, ...). // Detail carries the fix hint. StatusMisconfigured Status = "misconfigured" // StatusSkipped means the check does not apply (e.g. no browser configured). StatusSkipped Status = "skipped" )