outcomes

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoDiagnosticInfo is used when a check does not have diagnostic information to show.
	NoDiagnosticInfo = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Fail

type Fail struct {
	Error error
}

Fail is the check outcome for checks that fail or encounter errors.

func (Fail) GetDiagnostics

func (o Fail) GetDiagnostics() string

GetDiagnostics implements outcomes.Outcome.

func (Fail) GetError

func (o Fail) GetError() error

GetError implements outcomes.Outcome.

func (Fail) GetOutcomeType

func (Fail) GetOutcomeType() string

GetOutcomeType implements outcomes.Outcome.

type Info

type Info struct {
	Diagnostics string
}

Info is the check outcome for checks that cannot be categorized as pass or fail, but instead simply give information about the status of the mesh/its components. These checks show dynamically-generated diagnostic information to the user to provide more context. Ex: check whether a pod participates in an SMI TrafficSplit or not, if yes - output the name of the TrafficSplit

func (Info) GetDiagnostics

func (o Info) GetDiagnostics() string

GetDiagnostics implements outcomes.Outcome.

func (Info) GetError

func (o Info) GetError() error

GetError implements outcomes.Outcome.

func (Info) GetOutcomeType

func (Info) GetOutcomeType() string

GetOutcomeType implements outcomes.Outcome.

type Outcome

type Outcome interface {
	// GetOutcomeType returns the type of the check outcome: pass/fail/info/unknown.
	GetOutcomeType() string

	// GetDiagnostics returns detailed diagnostics that were dynamically-generated during the check.
	// Diagnostics may include details about a test failure or information about the mesh/its components
	GetDiagnostics() string

	// GetError returns the error which common.Runnable{}.Run() returned.
	GetError() error
}

Outcome is the printable context returned from a check (common.Runnable).

type Pass

type Pass struct {
	Msg string
}

Pass is for check outcomes that are successful and do not have diagnostic information to show.

func (Pass) GetDiagnostics

func (o Pass) GetDiagnostics() string

GetDiagnostics implements outcomes.Outcome.

func (Pass) GetError

func (o Pass) GetError() error

GetError implements outcomes.Outcome.

func (Pass) GetOutcomeType

func (Pass) GetOutcomeType() string

GetOutcomeType implements outcomes.Outcome.

type Unknown

type Unknown struct{}

Unknown is the outcome type that occurs when the check did not have a conclusive result

func (Unknown) GetDiagnostics

func (o Unknown) GetDiagnostics() string

GetDiagnostics implements outcomes.Outcome.

func (Unknown) GetError

func (o Unknown) GetError() error

GetError implements outcomes.Outcome.

func (Unknown) GetOutcomeType

func (Unknown) GetOutcomeType() string

GetOutcomeType implements outcomes.Outcome.

Jump to

Keyboard shortcuts

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