severity

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Common severities
	SeverityCritical      = "Critical"
	SeverityHigh          = "High"
	SeverityMedium        = "Medium"
	SeverityLow           = "Low"
	SeverityInformational = "Informational"
	SeverityNone          = "None"
	SeverityUnknown       = "Unknown"
)

Variables

This section is empty.

Functions

func ParseSeverity

func ParseSeverity(sev string) (string, error)

func SeveritiesAll

func SeveritiesAll() []string

func SeveritiesAnalyzed

func SeveritiesAnalyzed() []string

func SeveritiesFinding

func SeveritiesFinding() []string

func SeveritiesHigher added in v0.4.0

func SeveritiesHigher(sevs []string, sev string, inclusive bool) ([]string, error)

SeveritiesHigher returns a subset of the provided severities with elements that with a lower index than the provided severity. The provided severities mus be ranked from high to low.

func SeveritiesLower added in v0.5.0

func SeveritiesLower(sevs []string, sev string, inclusive bool) ([]string, error)

SeveritiesLower returns a subset of the provided severities with elements that with a higher index than the provided severity. The provided severities mus be ranked from high to low.

func SeverityMapScoreDefault added in v0.4.0

func SeverityMapScoreDefault() map[string]decimal.Decimal

Types

type MapBool

type MapBool map[string]bool

func NewMapBool

func NewMapBool(def bool) MapBool

func (MapBool) AllTrue

func (mb MapBool) AllTrue(strict bool) bool

AllTrueStrict checks if all severities are true. Strict checks that no additional severities are included in the map.

type SeverityMap

type SeverityMap map[string]decimal.Decimal

func NewSeverityMapFromFloat32

func NewSeverityMapFromFloat32(m map[string]float32) (SeverityMap, error)

func NewSeverityMapSeveritiesOnly added in v0.4.0

func NewSeverityMapSeveritiesOnly(severities []string) (SeverityMap, error)

func (SeverityMap) SeverityFromScore

func (sm SeverityMap) SeverityFromScore(score decimal.Decimal) (string, error)

func (SeverityMap) SeverityFromScoreFloat32

func (sm SeverityMap) SeverityFromScoreFloat32(score float32) (string, error)

Jump to

Keyboard shortcuts

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