doctor

package
v0.37.8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRuntimeDetectionCheck

func NewRuntimeDetectionCheck() *runtimeDetectionCheck

NewRuntimeDetectionCheck creates a new runtime detection check

Types

type Check

type Check struct {
	Name      string
	Category  CheckCategory
	Severity  CheckSeverity
	ShouldRun bool
}

Check defines base metadata for a diagnostic check

func (*Check) GetCheck

func (c *Check) GetCheck() *Check

GetCheck returns the check metadata (satisfies CheckRunner interface)

func (*Check) NewCheckResult

func (c *Check) NewCheckResult() CheckResult

NewCheckResult creates a base CheckResult for a check

type CheckCategory

type CheckCategory string

CheckCategory groups related checks

const (
	CategoryRuntime      CheckCategory = "Container Runtime"
	CategoryConnectivity CheckCategory = "Runtime Connectivity"
	CategoryBuildTools   CheckCategory = "Build Tools"
	CategoryNetwork      CheckCategory = "Network Access"
	CategorySystem       CheckCategory = "System Resources"
	CategoryPermissions  CheckCategory = "User Permissions"
	CategoryGitHub       CheckCategory = "GitHub Actions"
)

type CheckResult

type CheckResult struct {
	Error       error
	Metadata    map[string]interface{}
	CheckName   string
	Category    CheckCategory
	Severity    CheckSeverity
	Status      CheckStatus
	Message     string
	Details     []string
	Suggestions []string
}

CheckResult contains check execution results

type CheckRunner

type CheckRunner interface {
	Run(ctx context.Context) CheckResult
	GetCheck() *Check
}

CheckRunner interface defines the contract for running checks

type CheckSeverity

type CheckSeverity string

CheckSeverity indicates check importance

const (
	SeverityCritical CheckSeverity = "critical" // Must pass for engine-ci to work
	SeverityWarning  CheckSeverity = "warning"  // Should pass but engine-ci might work
	SeverityInfo     CheckSeverity = "info"     // Informational only
)

type CheckStatus

type CheckStatus string

CheckStatus represents check result

const (
	StatusPass    CheckStatus = "pass"
	StatusFail    CheckStatus = "fail"
	StatusWarning CheckStatus = "warning"
	StatusSkipped CheckStatus = "skipped"
)

type Doctor

type Doctor struct {
	// contains filtered or unexported fields
}

Doctor coordinates diagnostic checks

func NewDoctor

func NewDoctor(opts DoctorOptions) *Doctor

NewDoctor creates a new doctor instance

func (*Doctor) RegisterCheck

func (d *Doctor) RegisterCheck(check CheckRunner)

RegisterCheck adds a check to the doctor

func (*Doctor) RunChecks

func (d *Doctor) RunChecks(ctx context.Context) []CheckResult

RunChecks executes all applicable checks

type DoctorOptions

type DoctorOptions struct {
	Categories         []CheckCategory
	Verbose            bool
	JSONOutput         bool
	IncludeWarnings    bool
	Parallel           bool
	KeepTestContainers bool // Don't cleanup test containers (for debugging)
}

DoctorOptions configures doctor behavior

type ResultFormatter

type ResultFormatter struct {
	// contains filtered or unexported fields
}

ResultFormatter handles output formatting

func NewResultFormatter

func NewResultFormatter(w io.Writer, verbose, jsonOutput, useColor bool) *ResultFormatter

NewResultFormatter creates a formatter

func (*ResultFormatter) FormatResults

func (f *ResultFormatter) FormatResults(results []CheckResult) error

FormatResults outputs all results

type RuntimeConnectivityCheck

type RuntimeConnectivityCheck struct {
	*Check
}

RuntimeConnectivityCheck verifies runtime API connectivity

func NewRuntimeConnectivityCheck

func NewRuntimeConnectivityCheck() *RuntimeConnectivityCheck

NewRuntimeConnectivityCheck creates a new runtime connectivity check

func (*RuntimeConnectivityCheck) Run

type RuntimeVersionCheck

type RuntimeVersionCheck struct {
	*Check
}

RuntimeVersionCheck verifies runtime version compatibility

func NewRuntimeVersionCheck

func NewRuntimeVersionCheck() *RuntimeVersionCheck

NewRuntimeVersionCheck creates a new runtime version check

func (*RuntimeVersionCheck) Run

type Summary

type Summary struct {
	Total    int `json:"total"`
	Passed   int `json:"passed"`
	Failed   int `json:"failed"`
	Warnings int `json:"warnings"`
	Skipped  int `json:"skipped"`
	Critical int `json:"critical_failures"`
}

Summary contains check result summary

type VolumeConfigCheck

type VolumeConfigCheck struct {
	*Check
}

VolumeConfigCheck verifies volume mount configuration

func NewVolumeConfigCheck

func NewVolumeConfigCheck() *VolumeConfigCheck

NewVolumeConfigCheck creates a new volume configuration check

func (*VolumeConfigCheck) Run

type VolumeWriteTestCheck

type VolumeWriteTestCheck struct {
	*Check
	KeepTestContainers bool
}

VolumeWriteTestCheck performs an integration test of volume mounting

func NewVolumeWriteTestCheck

func NewVolumeWriteTestCheck(keepTestContainers bool) *VolumeWriteTestCheck

NewVolumeWriteTestCheck creates a new volume write test check

func (*VolumeWriteTestCheck) Run

Jump to

Keyboard shortcuts

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