apis

package
v0.0.202 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 0 Imported by: 21

Documentation

Index

Constants

View Source
const (
	SeverityCriticalString = "Critical"
	SeverityHighString     = "High"
	SeverityMediumString   = "Medium"
	SeverityLowString      = "Low"
	SeverityUnknownString  = "Unknown"
)
View Source
const (
	SeverityUnknown  = iota
	SeverityLow      = iota
	SeverityMedium   = iota
	SeverityHigh     = iota
	SeverityCritical = iota
)
View Source
const NumberOfSeverities = 5

Variables

This section is empty.

Functions

func ControlSeverityToInt

func ControlSeverityToInt(baseScore float32) int

func ControlSeverityToString

func ControlSeverityToString(baseScore float32) string

func GetSupportedSeverities added in v0.0.194

func GetSupportedSeverities() []string

GetSupportedSeverities returns a slice of supported severities

func SeverityNumberToString added in v0.0.185

func SeverityNumberToString(severityNumber int) string

Types

type IStatus

type IStatus interface {
	Status() ScanningStatus
	Info() string
	IsPassed() bool
	IsFailed() bool
	IsExcluded() bool
	IsSkipped() bool
}

IStatus interface handling status

type ScanningStatus

type ScanningStatus string
const (
	StatusPassed     ScanningStatus = "passed"
	StatusExcluded   ScanningStatus = "excluded"
	StatusIgnored    ScanningStatus = "ignored"
	StatusFailed     ScanningStatus = "failed"
	StatusSkipped    ScanningStatus = "skipped"
	StatusUnknown    ScanningStatus = "" // keep this empty
	StatusIrrelevant ScanningStatus = "irrelevant"
	StatusError      ScanningStatus = "error"
)
const (
	InfoStatusSkipped ScanningStatus = "skipped"
)

func Compare

func Compare(a, b ScanningStatus) ScanningStatus

Compare receive two statuses and returns the more significant one

status level:
	1. failed
	2. excludes
	3. passed
	4. skipped/ignore

e.g.:
Compare(failed, excludes) -> failed
Compare(passed, excludes) -> excludes
Compare(skipped, excludes) -> excludes
Compare(failed, passed) -> failed

type StatusInfo

type StatusInfo struct {
	InnerStatus ScanningStatus `json:"status,omitempty"`
	InnerInfo   string         `json:"info,omitempty"`
}

func (*StatusInfo) Info

func (s *StatusInfo) Info() string

func (*StatusInfo) IsExcluded

func (s *StatusInfo) IsExcluded() bool

IsExcluded is the status excluded

func (*StatusInfo) IsFailed

func (s *StatusInfo) IsFailed() bool

IsFailed is the status fail

func (*StatusInfo) IsPassed

func (s *StatusInfo) IsPassed() bool

IsPassed is the status pass

func (*StatusInfo) IsSkipped

func (s *StatusInfo) IsSkipped() bool

IsSkipped is the status skipped

func (*StatusInfo) Status

func (s *StatusInfo) Status() ScanningStatus

Jump to

Keyboard shortcuts

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