doctor

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package doctor runs tomo's startup preconditions as a set of named checks: the config resolves a usable provider, the data dir is writable, and every configured channel has a driver. Each check hands back a fix in plain terms rather than a stack trace, so a stale config surfaces before it fails at runtime. Both `tomo doctor` and `serve` run these, so serve refuses to start half-configured instead of dying mid-turn.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OK

func OK(results []Result) bool

OK reports whether every check passed, for a caller deciding an exit code or whether serve may boot.

Types

type Result

type Result struct {
	Name   string
	OK     bool
	Detail string
}

Result is one check's outcome. Detail carries the fix when a check fails and a short confirmation when it passes.

func Check

func Check(cfg *config.Config) []Result

Check runs every precondition over an already-loaded config and returns the results in a stable order. Loading the config is the caller's job, because a parse error is itself the first thing to report and config.Load already names the fix for it.

Jump to

Keyboard shortcuts

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