Documentation ¶
Index ¶
- Constants
- Variables
- func FinalizeResults(data *cautils.OPASessionObj) *reporthandlingv2.PostureReport
- type HTMLReportingCtx
- type HtmlPrinter
- type JUnitFailure
- type JUnitProperty
- type JUnitSkipMessage
- type JUnitTestCase
- type JUnitTestSuite
- type JUnitTestSuites
- type JUnitXML
- type JsonPrinter
- type JunitPrinter
- type Matrix
- type Metrics
- type PdfPrinter
- type PrettyPrinter
- type PrometheusPrinter
- type ResourceControlResult
- type ResourceResult
- type ResourceTableView
- type SARIFPrinter
- type SilentPrinter
- type WorkloadSummary
Constants ¶
View Source
const TOP_RESOURCE_COUNT = 15
View Source
const TOP_VECTOR_COUNT = 10
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 (hp *HtmlPrinter) ActionPrint(ctx context.Context, opaSessionObj *cautils.OPASessionObj)
func (*HtmlPrinter) Score ¶
func (hp *HtmlPrinter) Score(score float32)
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 ¶
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 (jp *JsonPrinter) ActionPrint(ctx context.Context, opaSessionObj *cautils.OPASessionObj)
func (*JsonPrinter) Score ¶
func (jp *JsonPrinter) Score(score float32)
type JunitPrinter ¶
type JunitPrinter struct {
// contains filtered or unexported fields
}
func NewJunitPrinter ¶
func NewJunitPrinter(verbose bool) *JunitPrinter
func (*JunitPrinter) ActionPrint ¶
func (jp *JunitPrinter) ActionPrint(ctx context.Context, opaSessionObj *cautils.OPASessionObj)
func (*JunitPrinter) Score ¶
func (jp *JunitPrinter) Score(score float32)
type PdfPrinter ¶
type PdfPrinter struct {
// contains filtered or unexported fields
}
func NewPdfPrinter ¶
func NewPdfPrinter() *PdfPrinter
func (*PdfPrinter) ActionPrint ¶
func (pp *PdfPrinter) ActionPrint(ctx context.Context, opaSessionObj *cautils.OPASessionObj)
func (*PdfPrinter) Score ¶
func (pp *PdfPrinter) Score(score float32)
type PrettyPrinter ¶
type PrettyPrinter struct {
// contains filtered or unexported fields
}
func NewPrettyPrinter ¶
func (*PrettyPrinter) ActionPrint ¶
func (pp *PrettyPrinter) ActionPrint(_ context.Context, opaSessionObj *cautils.OPASessionObj)
func (*PrettyPrinter) Score ¶
func (pp *PrettyPrinter) Score(score float32)
type PrometheusPrinter ¶
type PrometheusPrinter struct {
// contains filtered or unexported fields
}
func NewPrometheusPrinter ¶
func NewPrometheusPrinter(verboseMode bool) *PrometheusPrinter
func (*PrometheusPrinter) ActionPrint ¶
func (pp *PrometheusPrinter) ActionPrint(ctx context.Context, opaSessionObj *cautils.OPASessionObj)
func (*PrometheusPrinter) Score ¶
func (pp *PrometheusPrinter) Score(score float32)
type ResourceControlResult ¶
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(_ context.Context, opaSessionObj *cautils.OPASessionObj)
func (*SARIFPrinter) Score ¶
func (sp *SARIFPrinter) Score(score float32)
type SilentPrinter ¶
type SilentPrinter struct { }
SilentPrinter is a printer that does not print anything
func (*SilentPrinter) ActionPrint ¶
func (silentPrinter *SilentPrinter) ActionPrint(ctx context.Context, opaSessionObj *cautils.OPASessionObj)
func (*SilentPrinter) Score ¶ added in v2.2.2
func (silentPrinter *SilentPrinter) Score(score float32)
type WorkloadSummary ¶
type WorkloadSummary struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.