printer

package
v2.0.393 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var INDENT = "   "

Functions

func FinalizeResults

func FinalizeResults(data *cautils.OPASessionObj) *reporthandlingv2.PostureReport

finalizeV2Report finalize the results objects by copying data from map to lists

Types

type HTMLReportingCtx

type HTMLReportingCtx struct {
	OPASessionObj     *cautils.OPASessionObj
	ResourceTableView ResourceTableView
}

type HtmlPrinter

type HtmlPrinter struct {
	// contains filtered or unexported fields
}

func NewHtmlPrinter

func NewHtmlPrinter() *HtmlPrinter

func (*HtmlPrinter) ActionPrint

func (htmlPrinter *HtmlPrinter) ActionPrint(opaSessionObj *cautils.OPASessionObj)

func (*HtmlPrinter) Score

func (htmlPrinter *HtmlPrinter) Score(score float32)

func (*HtmlPrinter) SetWriter

func (htmlPrinter *HtmlPrinter) SetWriter(outputFile string)

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"` // Full class name for the class the test method is in. required
	Name        string            `xml:"name,attr"`      // Name of the test method, required
	Time        string            `xml:"time,attr"`      // Time taken (in seconds) to execute the test. optional
	SkipMessage *JUnitSkipMessage `xml:"skipped,omitempty"`
	Failure     *JUnitFailure     `xml:"failure,omitempty"`
}

JUnitTestCase represents a single resource

type JUnitTestSuite

type JUnitTestSuite struct {
	XMLName    xml.Name        `xml:"testsuite"`
	Tests      int             `xml:"tests,attr"`     // total number of tests from this testsuite. Some software may expect to only see the number of successful tests though
	Name       string          `xml:"name,attr"`      // Full (class) name of the test for non-aggregated testsuite documents. Class name without the package for aggregated testsuites documents. Required
	Errors     int             `xml:"errors,attr"`    // The total number of tests in the suite that errors
	Failures   int             `xml:"failures,attr"`  // The total number of tests in the suite that failed
	Hostname   string          `xml:"hostname,attr"`  // Host on which the tests were executed ? cluster name ?
	ID         int             `xml:"id,attr"`        // Starts at 0 for the first testsuite and is incremented by 1 for each following testsuite
	Skipped    string          `xml:"skipped,attr"`   // The total number of skipped tests
	Time       string          `xml:"time,attr"`      // Time taken (in seconds) to execute the tests in the suite
	Timestamp  string          `xml:"timestamp,attr"` // when the test was executed in ISO 8601 format (2014-01-21T16:17:18)
	Properties []JUnitProperty `xml:"properties>property,omitempty"`
	TestCases  []JUnitTestCase `xml:"testcase"`
}

JUnitTestSuite represents a single control

type JUnitTestSuites

type JUnitTestSuites struct {
	XMLName  xml.Name         `xml:"testsuites"`
	Suites   []JUnitTestSuite `xml:"testsuite"`     // list of controls
	Errors   int              `xml:"errors,attr"`   // total number of tests with error result from all testsuites
	Failures int              `xml:"failures,attr"` // total number of failed tests from all testsuites
	Tests    int              `xml:"tests,attr"`    // total number of tests from all testsuites. Some software may expect to only see the number of successful tests from all testsuites though
	Time     string           `xml:"time,attr"`     // time in seconds to execute all test suites
	Name     string           `xml:"name,attr"`     // ? Add framework names ?
}

JUnitTestSuites represents the test summary

type JUnitXML

type JUnitXML struct {
	TestSuites JUnitTestSuites `xml:"testsuites"`
}

type JsonPrinter

type JsonPrinter struct {
	// contains filtered or unexported fields
}

func NewJsonPrinter

func NewJsonPrinter() *JsonPrinter

func (*JsonPrinter) ActionPrint

func (jsonPrinter *JsonPrinter) ActionPrint(opaSessionObj *cautils.OPASessionObj)

func (*JsonPrinter) Score

func (jsonPrinter *JsonPrinter) Score(score float32)

func (*JsonPrinter) SetWriter

func (jsonPrinter *JsonPrinter) SetWriter(outputFile string)

type JunitPrinter

type JunitPrinter struct {
	// contains filtered or unexported fields
}

riskScore status

func NewJunitPrinter

func NewJunitPrinter(verbose bool) *JunitPrinter

func (*JunitPrinter) ActionPrint

func (junitPrinter *JunitPrinter) ActionPrint(opaSessionObj *cautils.OPASessionObj)

func (*JunitPrinter) Score

func (junitPrinter *JunitPrinter) Score(score float32)

func (*JunitPrinter) SetWriter

func (junitPrinter *JunitPrinter) SetWriter(outputFile string)

type Matrix

type Matrix [][]string

func (Matrix) Len

func (a Matrix) Len() int

func (Matrix) Less

func (a Matrix) Less(i, j int) bool

func (Matrix) Swap

func (a Matrix) Swap(i, j int)

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

func (*Metrics) String

func (m *Metrics) String() string

type PdfPrinter

type PdfPrinter struct {
	// contains filtered or unexported fields
}

func NewPdfPrinter

func NewPdfPrinter() *PdfPrinter

func (*PdfPrinter) ActionPrint

func (pdfPrinter *PdfPrinter) ActionPrint(opaSessionObj *cautils.OPASessionObj)

func (*PdfPrinter) Score

func (pdfPrinter *PdfPrinter) Score(score float32)

func (*PdfPrinter) SetWriter

func (pdfPrinter *PdfPrinter) SetWriter(outputFile string)

type PrettyPrinter

type PrettyPrinter struct {
	// contains filtered or unexported fields
}

func NewPrettyPrinter

func NewPrettyPrinter(verboseMode bool, formatVersion string, viewType cautils.ViewTypes) *PrettyPrinter

func (*PrettyPrinter) ActionPrint

func (prettyPrinter *PrettyPrinter) ActionPrint(opaSessionObj *cautils.OPASessionObj)

func (*PrettyPrinter) Score

func (prettyPrinter *PrettyPrinter) Score(score float32)

func (*PrettyPrinter) SetWriter

func (prettyPrinter *PrettyPrinter) SetWriter(outputFile string)

type PrometheusPrinter

type PrometheusPrinter struct {
	// contains filtered or unexported fields
}

func NewPrometheusPrinter

func NewPrometheusPrinter(verboseMode bool) *PrometheusPrinter

func (*PrometheusPrinter) ActionPrint

func (printer *PrometheusPrinter) ActionPrint(opaSessionObj *cautils.OPASessionObj)

func (*PrometheusPrinter) Score

func (prometheusPrinter *PrometheusPrinter) Score(score float32)

func (*PrometheusPrinter) SetWriter

func (prometheusPrinter *PrometheusPrinter) SetWriter(outputFile string)

type ResourceControlResult

type ResourceControlResult struct {
	Severity    string
	Name        string
	ID          string
	URL         string
	FailedPaths []string
}

type ResourceResult

type ResourceResult struct {
	Resource       workloadinterface.IMetadata
	ControlsResult []ResourceControlResult
}

type ResourceTableView

type ResourceTableView []ResourceResult

type SARIFPrinter

type SARIFPrinter struct {
	// contains filtered or unexported fields
}

SARIFPrinter is a printer that emits the report in the SARIF format

func NewSARIFPrinter

func NewSARIFPrinter() *SARIFPrinter

NewSARIFPrinter returns a new SARIF printer instance

func (*SARIFPrinter) ActionPrint

func (sp *SARIFPrinter) ActionPrint(opaSessionObj *cautils.OPASessionObj)

func (*SARIFPrinter) Score

func (sp *SARIFPrinter) Score(score float32)

func (*SARIFPrinter) SetWriter

func (sp *SARIFPrinter) SetWriter(outputFile string)

type SilentPrinter

type SilentPrinter struct {
}

func (*SilentPrinter) ActionPrint

func (silentPrinter *SilentPrinter) ActionPrint(opaSessionObj *cautils.OPASessionObj)

type WorkloadSummary

type WorkloadSummary struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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