report

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 28 Imported by: 23

Documentation

Index

Constants

View Source
const (
	SchemaVersion = 2
)

Variables

View Source
var CustomTemplateFuncMap = make(map[string]interface{})

CustomTemplateFuncMap is used to overwrite existing functions for testing.

Functions

func ToPathUri added in v0.29.1

func ToPathUri(input string, resultClass types.ResultClass) string

func Write added in v0.19.0

func Write(ctx context.Context, report types.Report, option flag.Options) (err error)

Write 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(ctx context.Context, report types.Report) error

Write writes the results in JSON format

type SarifWriter added in v0.23.0

type SarifWriter struct {
	Output  io.Writer
	Version string

	Target string
	// contains filtered or unexported fields
}

SarifWriter implements result Writer

func (*SarifWriter) Write added in v0.23.0

func (sw *SarifWriter) Write(ctx context.Context, report types.Report) error

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, appVersion string) (*TemplateWriter, error)

NewTemplateWriter is the factory method to return TemplateWriter object

func (TemplateWriter) Write added in v0.2.0

func (tw TemplateWriter) Write(ctx context.Context, report types.Report) error

Write writes result

type Writer

type Writer interface {
	Write(context.Context, types.Report) error
}

Writer defines the result write operation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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