reporting

package
v0.0.0-...-adb70a5 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package reporting is the shac starlark engine reporting implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiReport

type MultiReport struct {
	Reporters []Report
}

MultiReport is a Report that wraps any number of other Report objects and tees output to all of them.

func Get

func Get(ctx context.Context) (*MultiReport, error)

Get returns the right reporting implementation based on the current environment.

func (*MultiReport) CheckCompleted

func (t *MultiReport) CheckCompleted(ctx context.Context, check string, start time.Time, d time.Duration, level engine.Level, err error)

func (*MultiReport) Close

func (t *MultiReport) Close() error

func (*MultiReport) EmitArtifact

func (t *MultiReport) EmitArtifact(ctx context.Context, check, root, file string, content []byte) error

func (*MultiReport) EmitFinding

func (t *MultiReport) EmitFinding(ctx context.Context, check string, level engine.Level, message, root, file string, s engine.Span, replacements []string) error

func (*MultiReport) Print

func (t *MultiReport) Print(ctx context.Context, check, file string, line int, message string)

type Report

type Report interface {
	io.Closer
	engine.Report
}

Report is a closable engine.Report.

type SarifReport

type SarifReport struct {
	// SARIF output gets written here when Close() is called.
	Out io.Writer
	// contains filtered or unexported fields
}

SarifReport converts findings into SARIF JSON output.

func (*SarifReport) CheckCompleted

func (sr *SarifReport) CheckCompleted(ctx context.Context, check string, start time.Time, d time.Duration, level engine.Level, err error)

func (*SarifReport) Close

func (sr *SarifReport) Close() error

func (*SarifReport) EmitArtifact

func (sr *SarifReport) EmitArtifact(ctx context.Context, root, check, file string, content []byte) error

func (*SarifReport) EmitFinding

func (sr *SarifReport) EmitFinding(ctx context.Context, check string, level engine.Level, message, root, file string, s engine.Span, replacements []string) error

func (*SarifReport) Print

Jump to

Keyboard shortcuts

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