output

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintJSONResults

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

PrintJSONResults writes results to the provided writer in JSON format

func PrintTableResults

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

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

Types

type Reporter

type Reporter struct {
	// contains filtered or unexported fields
}

func NewReporter

func NewReporter(stdout io.Writer, stderr io.Writer, outputAsJSON bool) *Reporter

func NewVoidReporter

func NewVoidReporter() *Reporter

NewVoidReporter creates a reporter that doesn't report to anywhere

func (*Reporter) PrintError

func (r *Reporter) PrintError(msg string)

PrintError writes the given message to stderr, regardless of if the reporter is outputting as JSON or not

func (*Reporter) PrintResult

func (r *Reporter) PrintResult(vulnResult *models.VulnerabilityResults) error

func (*Reporter) PrintText

func (r *Reporter) PrintText(msg string)

PrintText writes the given message to stdout, _unless_ the reporter is set to output as JSON, in which case it writes the message to stderr.

This should be used for content that should always be outputted, but that should not be captured when piping if outputting JSON.

Jump to

Keyboard shortcuts

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