doctor

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package doctor runs diagnostic steps in order and prints what is wrong and how to fix it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Failed

func Failed(lines []Line) bool

Failed reports whether any step failed.

func Print

func Print(w io.Writer, lines []Line)

Print writes one line per step, and the hint of a problem under it.

Types

type Line

type Line struct {
	Name string
	Outcome
}

Line is the outcome of a named step.

func Run

func Run(ctx context.Context, steps []Step) []Line

Run executes the steps in order, each with a time limit. After a failure the remaining steps are skipped.

type Outcome

type Outcome struct {
	Status Status
	Detail string
	Hint   string
}

Outcome is what a step reports: what it found, and for a problem what to try.

func Failure

func Failure(detail, hint string) Outcome

Failure reports a problem; the steps after it are skipped, since they depend on it.

func Pass

func Pass(detail string) Outcome

Pass reports a step that found nothing wrong.

func Skipped

func Skipped(detail string) Outcome

Skipped reports a step that does not apply.

func Warning

func Warning(detail, hint string) Outcome

Warning reports something worth knowing that does not stop the next steps.

type Status

type Status int

Status is how a step went.

const (
	OK Status = iota
	Warn
	Fail
	Skip
)

The possible statuses.

func (Status) String

func (s Status) String() string

type Step

type Step struct {
	Name string
	Run  func(ctx context.Context) Outcome
}

Step is one check.

Jump to

Keyboard shortcuts

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