audit

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Outcomes = [...]Outcome{
	Pass,
	PassWithIssues,
	Fail,
	Skipped,
}

Outcomes is the list of possible outcomes values

Functions

func LogQuiet

func LogQuiet()

LogQuiet turns off all log level, including Critical

func LogVerbose

func LogVerbose()

LogVerbose turns on all log level, including Debug

func RunCheck

func RunCheck(check Check, ar *archive.Reader, limit uint) (Outcome, *ExamplesCollection)

RunCheck is a wrapper to run a check, handling setup and errors

Types

type Check

type Check struct {
	Name        string
	Description string
	// contains filtered or unexported fields
}

Check is the basic unit of analysis that is run against a data archive

func GetDefaultChecks

func GetDefaultChecks() []Check

GetDefaultChecks creates the default list of check using default parameters

type ExamplesCollection

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

ExamplesCollection stores examples of issues found by a check as it scans entities in an archive. A limit can be passed to avoid accumulating hundreds of example. After the limit is reached, further examples are just counted but not stored.

func (*ExamplesCollection) Count

func (c *ExamplesCollection) Count() int

Count the number of examples added to this collection (including the omitted ones)

func (*ExamplesCollection) String

func (c *ExamplesCollection) String() string

String produces a multi-line string with one example per line. If more examples were added than the limit, an extra line is printed with the number of omitted examples.

type Outcome

type Outcome int

Outcome of running a check against the data gathered into an archive

const (
	// Pass is for no issues detected
	Pass Outcome = iota
	// PassWithIssues is for non-critical problems
	PassWithIssues Outcome = iota
	// Fail indicates a bad state is detected
	Fail Outcome = iota
	// Skipped is for checks that failed to run (no data, runtime error, ...)
	Skipped Outcome = iota
)

func (Outcome) String

func (o Outcome) String() string

String converts an outcome into a 4-letter string value

Jump to

Keyboard shortcuts

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