Documentation
¶
Overview ¶
Package doctor provides a diagnostic command that validates configuration, checks environment health, and reports runtime details.
Index ¶
- func NewCmdDoctor(props *p.Props) *setup.Command
- func NewCmdReport(props *p.Props) *cobra.Command
- func PrintBundle(w io.Writer, b *SupportBundle)
- func PrintReport(w io.Writer, report *DoctorReport)
- type CheckFunc
- type CheckResult
- type CheckStatus
- type DoctorReport
- type FeatureFlag
- type PathsSection
- type RuntimeSection
- type SupportBundle
- type ToolSection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCmdDoctor ¶
NewCmdDoctor creates the doctor command.
func NewCmdReport ¶ added in v0.22.0
NewCmdReport returns the `doctor report` subcommand: it prints a single, secret-redacted, paste-ready support bundle. It is gated implicitly by being a child of the DoctorCmd-gated `doctor` command.
func PrintBundle ¶ added in v0.22.0
func PrintBundle(w io.Writer, b *SupportBundle)
PrintBundle renders the human-readable bundle: a header, then labelled sections, reusing PrintReport for the checks for visual consistency.
func PrintReport ¶
func PrintReport(w io.Writer, report *DoctorReport)
PrintReport writes a human-readable report to the given writer.
Types ¶
type CheckFunc ¶
CheckFunc is an alias for the registry's CheckFunc type.
func DefaultChecks ¶
func DefaultChecks() []CheckFunc
DefaultChecks returns the standard set of diagnostic checks.
type CheckResult ¶
type CheckResult = setup.CheckResult
CheckResult is an alias for the registry's CheckResult type.
type CheckStatus ¶
type CheckStatus = string
CheckStatus is the outcome of a diagnostic check.
const ( CheckPass CheckStatus = "pass" CheckWarn CheckStatus = "warn" CheckFail CheckStatus = "fail" CheckSkip CheckStatus = "skip" )
type DoctorReport ¶
type DoctorReport struct {
Tool string `json:"tool"`
Version string `json:"version"`
Checks []CheckResult `json:"checks"`
}
DoctorReport contains all check results.
type FeatureFlag ¶ added in v0.22.0
type FeatureFlag struct {
Cmd p.FeatureCmd `json:"cmd"`
Enabled bool `json:"enabled"`
}
FeatureFlag is one built-in feature's enabled/disabled state.
type PathsSection ¶ added in v0.22.0
type PathsSection struct {
ConfigDir string `json:"config_dir,omitempty"`
ConfigFile string `json:"config_file,omitempty"`
}
PathsSection holds the resolved config locations (no cache dir — GTB has no cache subsystem).
type RuntimeSection ¶ added in v0.22.0
type RuntimeSection struct {
Go string `json:"go"`
OS string `json:"os"`
Arch string `json:"arch"`
}
RuntimeSection holds the Go runtime and host OS/arch.
type SupportBundle ¶ added in v0.22.0
type SupportBundle struct {
Tool ToolSection `json:"tool"`
Runtime RuntimeSection `json:"runtime"`
Paths PathsSection `json:"paths"`
Features []FeatureFlag `json:"features"`
Config map[string]any `json:"config"` // redacted, key-name-preserving
Doctor *DoctorReport `json:"doctor,omitempty"`
}
SupportBundle is the fully-collected, already-redacted output of `doctor report`. Every string field and every value in Config has passed through pkg/redact before CollectBundle returns it. It subsumes a plain `doctor` run by embedding the DoctorReport.
func CollectBundle ¶ added in v0.22.0
func CollectBundle(ctx context.Context, props *p.Props) *SupportBundle
CollectBundle gathers the support bundle and applies the redaction perimeter. It is total: nil Config or nil Version yield empty/omitted sections, never a panic.