Documentation ¶
Overview ¶
Package diagnosis contains types used by the "agent diagnose" command.
Index ¶
Constants ¶
View Source
const ( DiagnosisSuccess Result = 0 DiagnosisFail Result = 1 DiagnosisWarning Result = 2 DiagnosisUnexpectedError = 3 DiagnosisResultMIN = DiagnosisSuccess DiagnosisResultMAX = DiagnosisUnexpectedError )
Diagnosis results
Variables ¶
View Source
var MetadataAvailCatalog = make(MetadataAvailDiagnoseCatalog)
MetadataAvailCatalog is a set of MetadataAvailDiagnose functions
Functions ¶
func RegisterMetadataAvail ¶
func RegisterMetadataAvail(name string, d MetadataAvailDiagnose)
RegisterMetadataAvail adds a MetadataAvailDiagnose
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog stores the list of registered Diagnose functions
type Counters ¶
type Counters struct { Total int `json:"total,omitempty"` Success int `json:"success,omitempty"` Fail int `json:"fail,omitempty"` Warnings int `json:"warnings,omitempty"` UnexpectedErr int `json:"unexpected_error,omitempty"` }
Counters contains the count of the diagnosis results
type DiagnoseResult ¶
type DiagnoseResult struct { Diagnoses []Diagnoses `json:"runs"` Summary Counters `json:"summary"` }
DiagnoseResult contains the results of the diagnose command
type Diagnoses ¶
type Diagnoses struct { SuiteName string `json:"suite_name"` SuiteDiagnoses []Diagnosis `json:"diagnoses"` }
Diagnoses is a collection of Diagnosis
type Diagnosis ¶
type Diagnosis struct { // run-time (pass, fail etc) Result Result `json:"result"` // static-time (meta typically) Name string `json:"name"` // run-time (actual diagnosis consumable by a user) Diagnosis string `json:"diagnosis"` // static-time (meta typically) Category string `json:"category,omitempty"` // static-time (meta typically, description of what being tested) Description string `json:"description,omitempty"` // run-time (what can be done of what docs need to be consulted to address the issue) Remediation string `json:"remediation,omitempty"` // run-time RawError string `json:"rawerror,omitempty"` }
Diagnosis contains the results of the diagnosis
func (Diagnosis) MarshalJSON ¶
MarshalJSON marshals the Diagnose struct to JSON
type MetadataAvailDiagnose ¶
type MetadataAvailDiagnose func() error
MetadataAvailDiagnose represents a function to fetch the metadata availability
type MetadataAvailDiagnoseCatalog ¶
type MetadataAvailDiagnoseCatalog map[string]MetadataAvailDiagnose
MetadataAvailDiagnoseCatalog is a set of MetadataAvailDiagnose functions
Click to show internal directories.
Click to hide internal directories.