diagnosis

package
v0.0.0-...-4dd3f74 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 1 Imported by: 14

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

func NewCatalog

func NewCatalog() *Catalog

NewCatalog returns a new Catalog instance

func (*Catalog) GetSuites

func (c *Catalog) GetSuites() []Suite

GetSuites returns the list of registered Diagnose functions

func (*Catalog) Register

func (c *Catalog) Register(suiteName string, diagnose Diagnose)

Register registers the given Diagnose function

type Config

type Config struct {
	Verbose  bool
	RunLocal bool
	Include  []string
	Exclude  []string
}

Config contains the Diagnose configuration

type Diagnose

type Diagnose func() []Diagnosis

Diagnose interface function

type Diagnoses

type Diagnoses struct {
	SuiteName      string
	SuiteDiagnoses []Diagnosis
}

Diagnoses is a collection of Diagnosis

type Diagnosis

type Diagnosis struct {

	// run-time (pass, fail etc)
	Result Result
	// static-time (meta typically)
	Name string
	// run-time (actual diagnosis consumable by a user)
	Diagnosis string

	// static-time (meta typically)
	Category string `json:",omitempty"`
	// static-time (meta typically, description of what being tested)
	Description string
	// run-time (what can be done of what docs need to be consulted to address the issue)
	Remediation string
	// run-time
	RawError string
}

Diagnosis contains the results of the diagnosis

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

type Result

type Result int

Result contains the result of the diagnosis

type Suite

type Suite struct {
	SuitName string
	Diagnose Diagnose
}

Suite contains the Diagnose suite information

Jump to

Keyboard shortcuts

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