output

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const OSVBaseVulnerabilityURL = "https://osv.dev/"

OSVBaseVulnerabilityURL is the base URL for detailed vulnerability views. Copied in from osv package to avoid referencing the osv package unnecessarily

View Source
const SARIFTemplate = `` /* 1269-byte string literal not displayed */

Two double-quotes ("") is replaced with a single backtick (`), since we can't embed backticks in raw strings

Variables

This section is empty.

Functions

func Form added in v1.4.0

func Form(count int, singular, plural string) string

Form returns the singular or plural form that should be used based on the given count

func GroupFixedVersions added in v1.4.0

func GroupFixedVersions(flattened []models.VulnerabilityFlattened) map[string][]string

GroupFixedVersions builds the fixed versions for each ID Group, with keys formatted like so: `Source:ID`

func MaxSeverity added in v1.4.0

func MaxSeverity(group models.GroupInfo, pkg models.PackageVulns) string

func PrintCycloneDXResults added in v1.8.2

func PrintCycloneDXResults(vulnResult *models.VulnerabilityResults, cycloneDXVersion models.CycloneDXVersion, outputWriter io.Writer) error

PrintCycloneDXResults writes results to the provided writer in CycloneDX format

func PrintGHAnnotationReport added in v1.4.0

func PrintGHAnnotationReport(vulnResult *models.VulnerabilityResults, outputWriter io.Writer) error

PrintGHAnnotationReport prints Github specific annotations to outputWriter

func PrintJSONResults

func PrintJSONResults(vulnResult *models.VulnerabilityResults, outputWriter io.Writer) error

PrintJSONResults writes results to the provided writer in JSON format

func PrintMarkdownTableResults added in v1.2.0

func PrintMarkdownTableResults(vulnResult *models.VulnerabilityResults, outputWriter io.Writer)

PrintTableResults prints the osv scan results into a human friendly table.

func PrintSARIFReport added in v1.4.0

func PrintSARIFReport(vulnResult *models.VulnerabilityResults, outputWriter io.Writer) error

PrintSARIFReport prints SARIF output to outputWriter

func PrintTableResults

func PrintTableResults(vulnResult *models.VulnerabilityResults, outputWriter io.Writer, terminalWidth int)

PrintTableResults prints the osv scan results into a human friendly table.

func PrintVerticalResults added in v1.8.3

func PrintVerticalResults(vulnResult *models.VulnerabilityResults, outputWriter io.Writer)

Types

type FixedPkgTableData added in v1.4.1

type FixedPkgTableData struct {
	VulnID       string
	PackageName  string
	FixedVersion string
}

type HelpTemplateData added in v1.4.1

type HelpTemplateData struct {
	ID                    string
	AffectedPackagesTable string
	AffectedPackagePaths  []string
	AliasedVulns          []VulnDescription
	HasFixedVersion       bool
	FixedVersionTable     string
}

type VulnDescription added in v1.4.1

type VulnDescription struct {
	ID      string
	Details string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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