writer

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 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.8.1

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 HumanReadbleWriter added in v1.3.0

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

HumanReadbleWriter 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 added in v1.4.0

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 added in v1.7.0

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 added in v1.4.0

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 added in v1.4.0

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 added in v1.4.0

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

JUnitSkipMessage contains the reason why a testcase was skipped.

type JUnitTestCase added in v1.4.0

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 added in v1.4.0

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 added in v1.4.0

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