doctor

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Probe

type Probe interface {
	ID() string
	Category() string
	Run(context.Context, *ProbeEnv) ([]contract.DiagnosticItem, error)
}

Probe executes one doctor diagnostic check.

type ProbeEnv

type ProbeEnv struct {
	Timeout time.Duration
	Now     func() time.Time
}

ProbeEnv carries shared probe dependencies.

type ProbeFunc

type ProbeFunc struct {
	ProbeID       string
	ProbeCategory string
	RunFunc       func(context.Context, *ProbeEnv) ([]contract.DiagnosticItem, error)
}

ProbeFunc adapts a function into a Probe for extensions and tests.

func (*ProbeFunc) Category

func (p *ProbeFunc) Category() string

func (*ProbeFunc) ID

func (p *ProbeFunc) ID() string

func (*ProbeFunc) Run

type Registry

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

Registry stores doctor probes and returns them sorted by ID.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates an empty probe registry.

func (*Registry) Probes

func (r *Registry) Probes() []Probe

Probes returns registered probes sorted by ID.

func (*Registry) Register

func (r *Registry) Register(probe Probe) error

Register adds one probe after validating its deterministic identity.

type RunOptions

type RunOptions struct {
	Only         []string
	Exclude      []string
	Quiet        bool
	Timeout      time.Duration
	ProbeTimeout time.Duration
	Env          ProbeEnv
}

RunOptions controls doctor execution.

type Runner

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

Runner executes registered probes in deterministic order.

func NewRunner

func NewRunner(registry *Registry) (*Runner, error)

NewRunner creates a deterministic doctor runner.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, opts RunOptions) ([]contract.DiagnosticItem, error)

Run executes every selected probe and sanitizes every returned DiagnosticItem.

Jump to

Keyboard shortcuts

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