reporter

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONReporter

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

func NewJSONReporter

func NewJSONReporter(stdout io.Writer, stderr io.Writer) *JSONReporter

func (*JSONReporter) HasPrintedError

func (r *JSONReporter) HasPrintedError() bool

func (*JSONReporter) PrintError

func (r *JSONReporter) PrintError(msg string)

func (*JSONReporter) PrintResult

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

func (*JSONReporter) PrintText

func (r *JSONReporter) PrintText(msg string)

type Reporter

type Reporter interface {
	// PrintError writes the given message to stderr, regardless of if the reporter
	// is outputting as JSON or not
	PrintError(msg string)
	HasPrintedError() bool
	// 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.
	PrintText(msg string)
	PrintResult(vulnResult *models.VulnerabilityResults) error
}

type TableReporter

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

func NewTableReporter

func NewTableReporter(stdout io.Writer, stderr io.Writer, markdown bool) *TableReporter

func (*TableReporter) HasPrintedError

func (r *TableReporter) HasPrintedError() bool

func (*TableReporter) PrintError

func (r *TableReporter) PrintError(msg string)

func (*TableReporter) PrintResult

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

func (*TableReporter) PrintText

func (r *TableReporter) PrintText(msg string)

type VoidReporter

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

func (*VoidReporter) HasPrintedError

func (r *VoidReporter) HasPrintedError() bool

func (*VoidReporter) PrintError

func (r *VoidReporter) PrintError(msg string)

func (*VoidReporter) PrintResult

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

func (*VoidReporter) PrintText

func (r *VoidReporter) PrintText(msg string)

Jump to

Keyboard shortcuts

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