report

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 21 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Now = time.Now

Now returns the current time

Functions

func WriteResults added in v0.2.0

func WriteResults(format string, output io.Writer, severities []dbTypes.Severity, results Results, outputTemplate string, light bool) error

WriteResults writes the result to output, format as passed in argument

Types

type JSONWriter added in v0.13.0

type JSONWriter struct {
	Output io.Writer
}

JSONWriter implements result Writer

func (JSONWriter) Write added in v0.13.0

func (jw JSONWriter) Write(results Results) error

Write writes the results in JSON format

type Result

type Result struct {
	Target          string                        `json:"Target"`
	Type            string                        `json:"Type,omitempty"`
	Packages        []ftypes.Package              `json:"Packages,omitempty"`
	Vulnerabilities []types.DetectedVulnerability `json:"Vulnerabilities"`
}

Result to hold image scan results

type Results

type Results []Result

Results to hold list of Result

type TableWriter

type TableWriter struct {
	Severities []dbTypes.Severity
	Output     io.Writer
	Light      bool
}

TableWriter implements Writer and output in tabular form

func (TableWriter) Write

func (tw TableWriter) Write(results Results) error

Write writes the result on standard output

type TemplateWriter added in v0.2.0

type TemplateWriter struct {
	Output   io.Writer
	Template *template.Template
}

TemplateWriter write result in custom format defined by user's template

func NewTemplateWriter added in v0.11.0

func NewTemplateWriter(output io.Writer, outputTemplate string) (*TemplateWriter, error)

NewTemplateWriter is the factory method to return TemplateWriter object

func (TemplateWriter) Write added in v0.2.0

func (tw TemplateWriter) Write(results Results) error

Write writes result

type Writer

type Writer interface {
	Write(Results) error
}

Writer defines the result write operation

Jump to

Keyboard shortcuts

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