reporter

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format added in v1.4.0

func Format() []string

Types

type GHAnnotationsReporter added in v1.4.0

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

func NewGHAnnotationsReporter added in v1.4.0

func NewGHAnnotationsReporter(stdout io.Writer, stderr io.Writer) *GHAnnotationsReporter

func (*GHAnnotationsReporter) HasPrintedError added in v1.4.0

func (r *GHAnnotationsReporter) HasPrintedError() bool

func (*GHAnnotationsReporter) PrintError added in v1.4.0

func (r *GHAnnotationsReporter) PrintError(msg string)

func (*GHAnnotationsReporter) PrintResult added in v1.4.0

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

func (*GHAnnotationsReporter) PrintText added in v1.4.0

func (r *GHAnnotationsReporter) PrintText(msg string)

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
}

func New added in v1.4.0

func New(format string, stdout, stderr io.Writer, terminalWidth int) (Reporter, error)

New returns an implementation of the reporter interface depending on the format passed in set terminalWidth as 0 to indicate the output is not a terminal

type SARIFReporter added in v1.4.0

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

func NewSarifReporter added in v1.4.0

func NewSarifReporter(stdout io.Writer, stderr io.Writer) *SARIFReporter

func (*SARIFReporter) HasPrintedError added in v1.4.0

func (r *SARIFReporter) HasPrintedError() bool

func (*SARIFReporter) PrintError added in v1.4.0

func (r *SARIFReporter) PrintError(msg string)

func (*SARIFReporter) PrintResult added in v1.4.0

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

func (*SARIFReporter) PrintText added in v1.4.0

func (r *SARIFReporter) PrintText(msg string)

type TableReporter

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

func NewTableReporter

func NewTableReporter(stdout io.Writer, stderr io.Writer, markdown bool, terminalWidth int) *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