output

package
v0.0.0-...-1a7096d Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 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 PrintMarkdownTableResults

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

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

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, format string) *Reporter

func NewVoidReporter

func NewVoidReporter() *Reporter

NewVoidReporter creates a reporter that doesn't report to anywhere

func (*Reporter) HasPrintedError

func (r *Reporter) HasPrintedError() bool

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