Documentation
¶
Index ¶
- func AllNames() []string
- type Confidence
- type Severities
- func (severities Severities) MarshalJSON() ([]byte, error)
- func (severities *Severities) Set(values string) error
- func (severities Severities) String() string
- func (severities *Severities) Type() string
- func (severities *Severities) UnmarshalJSON(data []byte) error
- func (severities *Severities) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Severity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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.