doctor

package
v0.9.25 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Key     string   `json:"key"`
	Section string   `json:"section"`
	Title   string   `json:"title"`
	Summary string   `json:"summary,omitempty"`
	URL     string   `json:"url,omitempty"`
	UsedBy  string   `json:"usedBy,omitempty"`
	Modules []string `json:"modules,omitempty"`
	Fn      CheckFn  `json:"-"`
	Solve   SolveFn  `json:"-"`
}

func (*Check) Check

func (c *Check) Check(ctx context.Context, logger util.Logger) *Result

type CheckFn

type CheckFn func(ctx context.Context, r *Result, logger util.Logger) *Result

type Checks

type Checks []*Check

func (Checks) Get added in v0.7.15

func (c Checks) Get(key string) *Check

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Args    []any  `json:"args,omitempty"`
}

func NewError

func NewError(code string, message string, args ...any) *Error

func (*Error) String

func (e *Error) String() string

type Errors

type Errors []*Error

func (Errors) Find

func (e Errors) Find(code string) *Error

type Result

type Result struct {
	Check    *Check   `json:"-"`
	Key      string   `json:"key"`
	Title    string   `json:"title"`
	Status   string   `json:"status,omitempty"`
	Summary  string   `json:"summary,omitempty"`
	Errors   Errors   `json:"errors,omitempty"`
	Duration int      `json:"duration,omitempty"`
	Solution []string `json:"solution,omitempty"`
	Logs     []string `json:"logs,omitempty"`
}

func NewResult

func NewResult(check *Check, key string, title string, summary string) *Result

func (*Result) AddLog

func (p *Result) AddLog(msg string) *Result

func (*Result) AddSolution

func (p *Result) AddSolution(msg string) *Result

func (*Result) WithError

func (p *Result) WithError(err *Error) *Result

type Results

type Results []*Result

type SolveFn

type SolveFn func(ctx context.Context, r *Result, logger util.Logger) *Result

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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