Help us shape the future of Go! Take the 2026 Go Developer Survey

doctor

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package doctor provides diagnostic functionality for checking stackit environment and repository health.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(ctx *app.Context, opts Options, handler Handler) error

Action runs diagnostic checks on the stackit environment and repository

Types

type Category

type Category string

Category represents a group of related checks

const (
	CategoryEnvironment Category = "environment"
	CategoryRepository  Category = "repository"
	CategoryStackState  Category = "stack_state"
)

Check category constants

type CheckStatus

type CheckStatus string

CheckStatus represents the result of a diagnostic check

const (
	CheckPassed  CheckStatus = "passed"
	CheckWarning CheckStatus = "warning"
	CheckError   CheckStatus = "error"
)

Check status constants

type Handler

type Handler interface {
	// Start is called at the beginning of doctor
	Start(fix bool)

	// OnCategory is called when starting a new category of checks
	OnCategory(category Category)

	// OnCheck is called for each individual check result
	OnCheck(name string, status CheckStatus, message string)

	// Complete is called when doctor finishes
	Complete(passed, warnings, errors int)

	// Cleanup restores terminal state (may be no-op)
	Cleanup()

	// IsInteractive returns true if the handler supports interactive prompts
	IsInteractive() bool
}

Handler receives events from doctor action

type NullHandler

type NullHandler struct {
	handler.NullBase
}

NullHandler is a no-op handler for when nil is passed. It embeds handler.NullBase for Cleanup() and IsInteractive().

func (*NullHandler) Complete

func (h *NullHandler) Complete(int, int, int)

Complete implements Handler.

func (*NullHandler) OnCategory

func (h *NullHandler) OnCategory(Category)

OnCategory implements Handler.

func (*NullHandler) OnCheck

func (h *NullHandler) OnCheck(string, CheckStatus, string)

OnCheck implements Handler.

func (*NullHandler) Start

func (h *NullHandler) Start(bool)

Start implements Handler.

type Options

type Options struct {
	Fix   bool
	Trunk string // Trunk branch name from config
}

Options contains options for the doctor command

Jump to

Keyboard shortcuts

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