writer

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitHubSarifWriter added in v1.18.2

func GitHubSarifWriter(data interface{}, writers []io.Writer) error

GitHubSarifWriter writes sarif formatted violation results report that are well suited for github codescanning alerts display

func HumanReadableWriter added in v1.18.2

func HumanReadableWriter(data interface{}, writers []io.Writer) error

HumanReadableWriter display scan summary in human readable format

func JSONWriter

func JSONWriter(data interface{}, writers []io.Writer) error

JSONWriter prints data in JSON format

func JUnitXMLWriter

func JUnitXMLWriter(data interface{}, writers []io.Writer) error

JUnitXMLWriter writes scan summary in junit xml format

func RegisterWriter

func RegisterWriter(format supportedFormat, writerFunc func(interface{}, []io.Writer) error)

RegisterWriter registers a writer for terrascan

func SarifWriter

func SarifWriter(data interface{}, writers []io.Writer) error

SarifWriter writes sarif formatted violation results report

func Write

func Write(format string, data interface{}, writers []io.Writer) error

Write method writes in the given format using the respective writer func

func XMLWriter

func XMLWriter(data interface{}, writers []io.Writer) error

XMLWriter prints data in XML format

func YAMLWriter

func YAMLWriter(data interface{}, writers []io.Writer) error

YAMLWriter prints data in YAML format

Types

type JUnitFailure

type JUnitFailure struct {
	Message  string `xml:"message,attr"`
	Type     string `xml:"type,attr"`
	Contents string `xml:",chardata"`
}

JUnitFailure contains data related to a failed test.

type JUnitProperty

type JUnitProperty struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

JUnitProperty represents a key/value pair used to define properties.

type JUnitSkipMessage

type JUnitSkipMessage struct {
	Message string `xml:"message,attr"`
}

JUnitSkipMessage contains the reason why a testcase was skipped.

type JUnitTestCase

type JUnitTestCase struct {
	XMLName   xml.Name `xml:"testcase"`
	Classname string   `xml:"classname,attr"`
	Name      string   `xml:"name,attr"`
	Severity  string   `xml:"severity,attr"`
	Category  string   `xml:"category,attr"`
	// omit empty time because today we do not have this data
	Time        string            `xml:"time,attr,omitempty"`
	SkipMessage *JUnitSkipMessage `xml:"skipped,omitempty"`
	Failure     *JUnitFailure     `xml:"failure,omitempty"`
}

JUnitTestCase is a single test case with its result.

type JUnitTestSuite

type JUnitTestSuite struct {
	XMLName    xml.Name        `xml:"testsuite"`
	Tests      int             `xml:"tests,attr"`
	Failures   int             `xml:"failures,attr"`
	Time       string          `xml:"time,attr"`
	Name       string          `xml:"name,attr"`
	Package    string          `xml:"package,attr"`
	Branch     string          `xml:"branch,attr,omitempty"`
	Properties []JUnitProperty `xml:"properties>property,omitempty"`
	TestCases  []JUnitTestCase
}

JUnitTestSuite is a single JUnit test suite which may contain many testcases.

type JUnitTestSuites

type JUnitTestSuites struct {
	XMLName  xml.Name `xml:"testsuites"`
	Tests    int      `xml:"tests,attr"`
	Name     string   `xml:"name,attr"`
	Failures int      `xml:"failures,attr"`
	Time     string   `xml:"time,attr"`
	Suites   []JUnitTestSuite
}

JUnitTestSuites is a collection of JUnit test suites.

Jump to

Keyboard shortcuts

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