severity

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllNames

func AllNames() []string

AllNames returns all known severity names in least-to-most-severe order, suitable for JSON schema enums or display.

Types

type Confidence

type Confidence int

Confidence represents the confidence level of a finding.

const (
	ConfidenceUndefined Confidence = iota
	Tentative                      // Possible but unconfirmed (e.g., heuristic-based detection)
	Firm                           // Likely confirmed by behavioral analysis
	Certain                        // Definitively confirmed (e.g., payload executed, error matched)
)

func ToConfidence

func ToConfidence(s string) Confidence

ToConfidence parses a string into a Confidence value.

func (Confidence) MarshalJSON

func (c Confidence) MarshalJSON() ([]byte, error)

func (Confidence) String

func (c Confidence) String() string

type Severities

type Severities []Severity

Severities is an array of Severity types

func (Severities) MarshalJSON

func (severities Severities) MarshalJSON() ([]byte, error)

func (*Severities) Set

func (severities *Severities) Set(values string) error

Set implements pflag.Value interface for parsing comma-separated severity values

func (Severities) String

func (severities Severities) String() string

func (*Severities) Type

func (severities *Severities) Type() string

Type implements pflag.Value interface

func (*Severities) UnmarshalJSON

func (severities *Severities) UnmarshalJSON(data []byte) error

func (*Severities) UnmarshalYAML

func (severities *Severities) UnmarshalYAML(unmarshal func(interface{}) error) error

type Severity

type Severity int
const (
	// name:undefined
	Undefined Severity = iota
	// name:info
	Info
	// name:suspect
	Suspect
	// name:low
	Low
	// name:medium
	Medium
	// name:high
	High
	// name:critical
	Critical
)

name:Severity

func ToSeverity

func ToSeverity(s string) Severity

ToSeverity maps a severity name onto its enum value, returning Undefined for an unrecognized name. Mirrors ToConfidence.

The enum is declared least-to-most severe, so the returned value doubles as a comparable rank — which is the point of exporting this: a caller that needs to *order* severities should resolve them here rather than re-type the ladder. Several hand-rolled copies still exist and have drifted (pkg/cli/severity_gate.go, pkg/agent/autopilot_pipeline.go, pkg/fsexport/render.go — the last ranks suspect below info); migrating them changes their ordering behavior, so it is deliberately a separate change, not something this helper has already done.

func (Severity) MarshalJSON

func (s Severity) MarshalJSON() ([]byte, error)

func (Severity) String

func (severity Severity) String() string

Jump to

Keyboard shortcuts

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