Documentation
¶
Index ¶
- Constants
- func Format() []string
- func VerbosityLevels() []string
- type CycloneDXReporter
- func (r *CycloneDXReporter) Errorf(format string, a ...any)
- func (r *CycloneDXReporter) HasErrored() bool
- func (r *CycloneDXReporter) Infof(format string, a ...any)
- func (r *CycloneDXReporter) PrintResult(vulnerabilityResults *models.VulnerabilityResults) error
- func (r *CycloneDXReporter) Verbosef(format string, a ...any)
- func (r *CycloneDXReporter) Warnf(format string, a ...any)
- type GHAnnotationsReporter
- func (r *GHAnnotationsReporter) Errorf(format string, a ...any)
- func (r *GHAnnotationsReporter) HasErrored() bool
- func (r *GHAnnotationsReporter) Infof(format string, a ...any)
- func (r *GHAnnotationsReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
- func (r *GHAnnotationsReporter) Verbosef(format string, a ...any)
- func (r *GHAnnotationsReporter) Warnf(format string, a ...any)
- type HTMLReporter
- func (r *HTMLReporter) Errorf(format string, a ...any)
- func (r *HTMLReporter) HasErrored() bool
- func (r *HTMLReporter) Infof(format string, a ...any)
- func (r *HTMLReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
- func (r *HTMLReporter) Verbosef(format string, a ...any)
- func (r *HTMLReporter) Warnf(format string, a ...any)
- type JSONReporter
- func (r *JSONReporter) Errorf(format string, a ...any)
- func (r *JSONReporter) HasErrored() bool
- func (r *JSONReporter) Infof(format string, a ...any)
- func (r *JSONReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
- func (r *JSONReporter) Verbosef(format string, a ...any)
- func (r *JSONReporter) Warnf(format string, a ...any)
- type Reporter
- type SARIFReporter
- func (r *SARIFReporter) Errorf(format string, a ...any)
- func (r *SARIFReporter) HasErrored() bool
- func (r *SARIFReporter) Infof(format string, a ...any)
- func (r *SARIFReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
- func (r *SARIFReporter) Verbosef(format string, a ...any)
- func (r *SARIFReporter) Warnf(format string, a ...any)
- type TableReporter
- func (r *TableReporter) Errorf(format string, a ...any)
- func (r *TableReporter) HasErrored() bool
- func (r *TableReporter) Infof(format string, a ...any)
- func (r *TableReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
- func (r *TableReporter) Verbosef(format string, a ...any)
- func (r *TableReporter) Warnf(format string, a ...any)
- type VerbosityLevel
- type VerticalReporter
- func (r *VerticalReporter) Errorf(format string, a ...any)
- func (r *VerticalReporter) HasErrored() bool
- func (r *VerticalReporter) Infof(format string, a ...any)
- func (r *VerticalReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
- func (r *VerticalReporter) Verbosef(format string, a ...any)
- func (r *VerticalReporter) Warnf(format string, a ...any)
- type VoidReporter
- func (r *VoidReporter) Errorf(_ string, _ ...any)
- func (r *VoidReporter) HasErrored() bool
- func (r *VoidReporter) Infof(_ string, _ ...any)
- func (r *VoidReporter) PrintResult(_ *models.VulnerabilityResults) error
- func (r *VoidReporter) Verbosef(_ string, _ ...any)
- func (r *VoidReporter) Warnf(_ string, _ ...any)
Constants ¶
View Source
const ( // ErrorLevel is for unexpected problems that require attention. ErrorLevel = iota // WarnLevel is for indicating potential issues or something that should be brought to the attention of users. WarnLevel // InfoLevel is for general information about what OSV-Scanner is doing during its runtime. InfoLevel // VerboseLevel is for providing even more information compared to InfoLevel about the inner workings of OSV-Scanner. VerboseLevel )
Variables ¶
This section is empty.
Functions ¶
func VerbosityLevels ¶
func VerbosityLevels() []string
Types ¶
type CycloneDXReporter ¶
type CycloneDXReporter struct {
// contains filtered or unexported fields
}
func NewCycloneDXReporter ¶
func NewCycloneDXReporter(stdout, stderr io.Writer, version models.CycloneDXVersion, level VerbosityLevel) *CycloneDXReporter
func (*CycloneDXReporter) Errorf ¶
func (r *CycloneDXReporter) Errorf(format string, a ...any)
func (*CycloneDXReporter) HasErrored ¶
func (r *CycloneDXReporter) HasErrored() bool
func (*CycloneDXReporter) Infof ¶
func (r *CycloneDXReporter) Infof(format string, a ...any)
func (*CycloneDXReporter) PrintResult ¶
func (r *CycloneDXReporter) PrintResult(vulnerabilityResults *models.VulnerabilityResults) error
func (*CycloneDXReporter) Verbosef ¶
func (r *CycloneDXReporter) Verbosef(format string, a ...any)
func (*CycloneDXReporter) Warnf ¶
func (r *CycloneDXReporter) Warnf(format string, a ...any)
type GHAnnotationsReporter ¶
type GHAnnotationsReporter struct {
// contains filtered or unexported fields
}
func NewGHAnnotationsReporter ¶
func NewGHAnnotationsReporter(stdout io.Writer, stderr io.Writer, level VerbosityLevel) *GHAnnotationsReporter
func (*GHAnnotationsReporter) Errorf ¶
func (r *GHAnnotationsReporter) Errorf(format string, a ...any)
func (*GHAnnotationsReporter) HasErrored ¶
func (r *GHAnnotationsReporter) HasErrored() bool
func (*GHAnnotationsReporter) Infof ¶
func (r *GHAnnotationsReporter) Infof(format string, a ...any)
func (*GHAnnotationsReporter) PrintResult ¶
func (r *GHAnnotationsReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
func (*GHAnnotationsReporter) Verbosef ¶
func (r *GHAnnotationsReporter) Verbosef(format string, a ...any)
func (*GHAnnotationsReporter) Warnf ¶
func (r *GHAnnotationsReporter) Warnf(format string, a ...any)
type HTMLReporter ¶
type HTMLReporter struct {
// contains filtered or unexported fields
}
func NewHTMLReporter ¶
func NewHTMLReporter(stdout io.Writer, stderr io.Writer, level VerbosityLevel) *HTMLReporter
func (*HTMLReporter) Errorf ¶
func (r *HTMLReporter) Errorf(format string, a ...any)
func (*HTMLReporter) HasErrored ¶
func (r *HTMLReporter) HasErrored() bool
func (*HTMLReporter) Infof ¶
func (r *HTMLReporter) Infof(format string, a ...any)
func (*HTMLReporter) PrintResult ¶
func (r *HTMLReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
func (*HTMLReporter) Verbosef ¶
func (r *HTMLReporter) Verbosef(format string, a ...any)
func (*HTMLReporter) Warnf ¶
func (r *HTMLReporter) Warnf(format string, a ...any)
type JSONReporter ¶
type JSONReporter struct {
// contains filtered or unexported fields
}
JSONReporter prints vulnerability results in JSON format to stdout. Runtime information will be written to stderr.
func NewJSONReporter ¶
func NewJSONReporter(stdout io.Writer, stderr io.Writer, level VerbosityLevel) *JSONReporter
func (*JSONReporter) Errorf ¶
func (r *JSONReporter) Errorf(format string, a ...any)
func (*JSONReporter) HasErrored ¶
func (r *JSONReporter) HasErrored() bool
func (*JSONReporter) Infof ¶
func (r *JSONReporter) Infof(format string, a ...any)
func (*JSONReporter) PrintResult ¶
func (r *JSONReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
func (*JSONReporter) Verbosef ¶
func (r *JSONReporter) Verbosef(format string, a ...any)
func (*JSONReporter) Warnf ¶
func (r *JSONReporter) Warnf(format string, a ...any)
type Reporter ¶
type Reporter interface {
// Errorf prints errors in an appropriate manner to ensure that results
// are printed in a way that is semantically valid for the intended consumer,
// and tracking that an error has been printed.
//
// Where the error is actually printed (if at all) is entirely up to the actual
// reporter, though generally it will be to stderr.
Errorf(format string, a ...any)
// HasErrored returns true if there have been any calls to Errorf.
//
// This does not actually represent if the error was actually printed anywhere
// since what happens to the error message is up to the actual reporter.
HasErrored() bool
// Warnf prints text indicating potential issues or something that should be brought to the attention of users.
Warnf(format string, a ...any)
// Infof prints text providing general information about what OSV-Scanner is doing during its runtime.
Infof(format string, a ...any)
// Verbosef prints text providing additional information about the inner workings of OSV-Scanner to the user.
Verbosef(format string, a ...any)
// PrintResult prints the models.VulnerabilityResults per the logic of the
// actual reporter
PrintResult(vulnResult *models.VulnerabilityResults) error
}
Reporter provides printing operations for vulnerability results and for runtime information (depending on the verbosity level given to the Reporter implementation).
When printing non-error-related runtime information, it is entirely up to the Reporter implementation as to where the text is actually printed (if at all); in most cases for "human format" reporters this will be stdout whereas for "machine format" reporters this will be stderr.
type SARIFReporter ¶
type SARIFReporter struct {
// contains filtered or unexported fields
}
func NewSarifReporter ¶
func NewSarifReporter(stdout io.Writer, stderr io.Writer, level VerbosityLevel) *SARIFReporter
func (*SARIFReporter) Errorf ¶
func (r *SARIFReporter) Errorf(format string, a ...any)
func (*SARIFReporter) HasErrored ¶
func (r *SARIFReporter) HasErrored() bool
func (*SARIFReporter) Infof ¶
func (r *SARIFReporter) Infof(format string, a ...any)
func (*SARIFReporter) PrintResult ¶
func (r *SARIFReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
func (*SARIFReporter) Verbosef ¶
func (r *SARIFReporter) Verbosef(format string, a ...any)
func (*SARIFReporter) Warnf ¶
func (r *SARIFReporter) Warnf(format string, a ...any)
type TableReporter ¶
type TableReporter struct {
// contains filtered or unexported fields
}
func NewTableReporter ¶
func NewTableReporter(stdout io.Writer, stderr io.Writer, level VerbosityLevel, markdown bool, terminalWidth int) *TableReporter
func (*TableReporter) Errorf ¶
func (r *TableReporter) Errorf(format string, a ...any)
func (*TableReporter) HasErrored ¶
func (r *TableReporter) HasErrored() bool
func (*TableReporter) Infof ¶
func (r *TableReporter) Infof(format string, a ...any)
func (*TableReporter) PrintResult ¶
func (r *TableReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
func (*TableReporter) Verbosef ¶
func (r *TableReporter) Verbosef(format string, a ...any)
func (*TableReporter) Warnf ¶
func (r *TableReporter) Warnf(format string, a ...any)
type VerbosityLevel ¶
type VerbosityLevel uint8
VerbosityLevel is used to determine what amount of information should be given in OSV-Scanner's runtime.
func ParseVerbosityLevel ¶
func ParseVerbosityLevel(text string) (VerbosityLevel, error)
type VerticalReporter ¶
type VerticalReporter struct {
// contains filtered or unexported fields
}
func NewVerticalReporter ¶
func NewVerticalReporter(stdout io.Writer, stderr io.Writer, level VerbosityLevel, markdown bool, terminalWidth int) *VerticalReporter
func (*VerticalReporter) Errorf ¶
func (r *VerticalReporter) Errorf(format string, a ...any)
func (*VerticalReporter) HasErrored ¶
func (r *VerticalReporter) HasErrored() bool
func (*VerticalReporter) Infof ¶
func (r *VerticalReporter) Infof(format string, a ...any)
func (*VerticalReporter) PrintResult ¶
func (r *VerticalReporter) PrintResult(vulnResult *models.VulnerabilityResults) error
func (*VerticalReporter) Verbosef ¶
func (r *VerticalReporter) Verbosef(format string, a ...any)
func (*VerticalReporter) Warnf ¶
func (r *VerticalReporter) Warnf(format string, a ...any)
type VoidReporter ¶
type VoidReporter struct {
// contains filtered or unexported fields
}
func (*VoidReporter) Errorf ¶
func (r *VoidReporter) Errorf(_ string, _ ...any)
func (*VoidReporter) HasErrored ¶
func (r *VoidReporter) HasErrored() bool
func (*VoidReporter) Infof ¶
func (r *VoidReporter) Infof(_ string, _ ...any)
func (*VoidReporter) PrintResult ¶
func (r *VoidReporter) PrintResult(_ *models.VulnerabilityResults) error
func (*VoidReporter) Verbosef ¶
func (r *VoidReporter) Verbosef(_ string, _ ...any)
func (*VoidReporter) Warnf ¶
func (r *VoidReporter) Warnf(_ string, _ ...any)
Click to show internal directories.
Click to hide internal directories.