Documentation ¶
Index ¶
- Variables
- func GetPrinter(printFormat string, verboseMode bool) printer.IPrinter
- type JUnitFailure
- type JUnitProperty
- type JUnitSkipMessage
- type JUnitTestCase
- type JUnitTestSuite
- type JUnitTestSuites
- type JsonPrinter
- type JunitPrinter
- type PrettyPrinter
- type PrometheusPrinter
- func (printer *PrometheusPrinter) ActionPrint(opaSessionObj *cautils.OPASessionObj)
- func (prometheusPrinter *PrometheusPrinter) FinalizeData(opaSessionObj *cautils.OPASessionObj)
- func (prometheusPrinter *PrometheusPrinter) Score(score float32)
- func (prometheusPrinter *PrometheusPrinter) SetWriter(outputFile string)
- type ResultSummary
- type SilentPrinter
- type Summary
- type WorkloadSummary
Constants ¶
This section is empty.
Variables ¶
View Source
var INDENT = " "
Functions ¶
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 ¶
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"` Time string `xml:"time,attr"` Resources int `xml:"resources,attr"` Excluded int `xml:"excluded,attr"` Failed int `xml:"filed,attr"` 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"` Time string `xml:"time,attr"` Name string `xml:"name,attr"` Resources int `xml:"resources,attr"` Excluded int `xml:"excluded,attr"` Failed int `xml:"filed,attr"` Properties []JUnitProperty `xml:"properties>property,omitempty"` TestCases []JUnitTestCase `xml:"testcase"` }
JUnitTestSuite is a single JUnit test suite which may contain many testcases.
type JUnitTestSuites ¶
type JUnitTestSuites struct { XMLName xml.Name `xml:"testsuites"` Suites []JUnitTestSuite `xml:"testsuite"` }
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) FinalizeData ¶
func (jsonPrinter *JsonPrinter) FinalizeData(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
}
func NewJunitPrinter ¶
func NewJunitPrinter() *JunitPrinter
func (*JunitPrinter) ActionPrint ¶
func (junitPrinter *JunitPrinter) ActionPrint(opaSessionObj *cautils.OPASessionObj)
func (*JunitPrinter) FinalizeData ¶
func (junitPrinter *JunitPrinter) FinalizeData(opaSessionObj *cautils.OPASessionObj)
func (*JunitPrinter) Score ¶
func (junitPrinter *JunitPrinter) Score(score float32)
func (*JunitPrinter) SetWriter ¶
func (junitPrinter *JunitPrinter) SetWriter(outputFile string)
type PrettyPrinter ¶
type PrettyPrinter struct {
// contains filtered or unexported fields
}
func NewPrettyPrinter ¶
func NewPrettyPrinter(verboseMode bool) *PrettyPrinter
func (*PrettyPrinter) ActionPrint ¶
func (prettyPrinter *PrettyPrinter) ActionPrint(opaSessionObj *cautils.OPASessionObj)
func (*PrettyPrinter) FinalizeData ¶
func (prettyPrinter *PrettyPrinter) FinalizeData(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) FinalizeData ¶
func (prometheusPrinter *PrometheusPrinter) FinalizeData(opaSessionObj *cautils.OPASessionObj)
func (*PrometheusPrinter) Score ¶
func (prometheusPrinter *PrometheusPrinter) Score(score float32)
func (*PrometheusPrinter) SetWriter ¶
func (prometheusPrinter *PrometheusPrinter) SetWriter(outputFile string)
type ResultSummary ¶
type ResultSummary struct { ID string RiskScore float32 TotalResources int TotalFailed int TotalWarning int Description string Remediation string Framework []string ListInputKinds []string FailedWorkloads map[string][]WorkloadSummary // <namespace>:[<WorkloadSummary>] ExcludedWorkloads map[string][]WorkloadSummary // <namespace>:[<WorkloadSummary>] PassedWorkloads map[string][]WorkloadSummary // <namespace>:[<WorkloadSummary>] }
func (*ResultSummary) ToSlice ¶
func (controlSummary *ResultSummary) ToSlice() []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
}
Click to show internal directories.
Click to hide internal directories.