Documentation ¶
Index ¶
- func NewDefaultCommand() *cobra.Command
- func NewParseCommand(ctx context.Context) *cobra.Command
- func NewPluginCommand(ctx context.Context) *cobra.Command
- func NewPluginInstallCommand(ctx context.Context) *cobra.Command
- func NewPullCommand(ctx context.Context) *cobra.Command
- func NewPushCommand(ctx context.Context, logger *log.Logger) *cobra.Command
- func NewTestCommand(ctx context.Context) *cobra.Command
- func NewVerifyCommand(ctx context.Context) *cobra.Command
- func ValidOutputs() []string
- type CheckResult
- type JSONOutputManager
- type JUnitOutputManager
- type OutputManager
- type Result
- type StandardOutputManager
- type TAPOutputManager
- type TableOutputManager
- type TestRun
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultCommand ¶
NewDefaultCommand creates the default command
func NewParseCommand ¶
NewParseCommand creates a parse command. This command can be used for printing structured inputs from unstructured configuration inputs.
func NewPluginCommand ¶
NewPluginCommand creates a new plugin command
func NewPluginInstallCommand ¶
NewPluginInstallCommand creates the install plugin subcommand
func NewPullCommand ¶
NewPullCommand creates a new pull command to allow users to download individual policies
func NewPushCommand ¶
NewPushCommand creates a new push command which allows users to push bundles to an OCI registry
func NewTestCommand ¶
NewTestCommand creates a new test command
func NewVerifyCommand ¶
NewVerifyCommand creates a new verify command which allows users to validate their rego unit tests
func ValidOutputs ¶
func ValidOutputs() []string
ValidOutputs returns the available output formats for reporting tests
Types ¶
type CheckResult ¶
type CheckResult struct { FileName string Warnings []Result Failures []Result Exceptions []Result Successes []Result }
CheckResult describes the result of a conftest evaluation. warning and failure "errors" produced by rego should be considered separate from other classes of exceptions.
type JSONOutputManager ¶
type JSONOutputManager struct {
// contains filtered or unexported fields
}
JSONOutputManager formats its output to JSON
func NewDefaultJSONOutputManager ¶
func NewDefaultJSONOutputManager() *JSONOutputManager
NewDefaultJSONOutputManager creates a new JSONOutputManager using the default logger
func NewJSONOutputManager ¶
func NewJSONOutputManager(l *log.Logger) *JSONOutputManager
NewJSONOutputManager creates a new JSONOutputManager with a given logger instance
func (*JSONOutputManager) Flush ¶
func (j *JSONOutputManager) Flush() error
Flush writes the contents of the managers buffer to the console
func (*JSONOutputManager) Put ¶
func (j *JSONOutputManager) Put(cr CheckResult) error
Put puts the result of the check to the manager in the managers buffer
type JUnitOutputManager ¶ added in v0.20.0
type JUnitOutputManager struct {
// contains filtered or unexported fields
}
JUnitOutputManager formats its output as a JUnit test result
func NewDefaultJUnitOutputManager ¶ added in v0.20.0
func NewDefaultJUnitOutputManager() *JUnitOutputManager
NewDefaultJUnitOutputManager creates a new JUnitOutputManager using standard out
func NewJUnitOutputManager ¶ added in v0.20.0
func NewJUnitOutputManager(w io.Writer) *JUnitOutputManager
NewJUnitOutputManager creates a new JUnitOutputManager with a given Writer
func (*JUnitOutputManager) Flush ¶ added in v0.20.0
func (j *JUnitOutputManager) Flush() error
Flush writes the contents of the managers buffer to the console
func (*JUnitOutputManager) Put ¶ added in v0.20.0
func (j *JUnitOutputManager) Put(cr CheckResult) error
Put puts the result of the check to the manager in the managers buffer
type OutputManager ¶
type OutputManager interface { Put(cr CheckResult) error Flush() error }
OutputManager controls how results of an evaluation will be recorded and reported to the end user
func GetOutputManager ¶
func GetOutputManager(outputFormat string, color bool) OutputManager
GetOutputManager returns the OutputManager based on the user input
type Result ¶
Result describes the result of a single rule evaluation.
type StandardOutputManager ¶
type StandardOutputManager struct {
// contains filtered or unexported fields
}
StandardOutputManager writes to stdout
func NewDefaultStandardOutputManager ¶
func NewDefaultStandardOutputManager(color bool) *StandardOutputManager
NewDefaultStandardOutputManager creates a new StandardOutputManager using the default logger
func NewStandardOutputManager ¶
func NewStandardOutputManager(l *log.Logger, color bool) *StandardOutputManager
NewStandardOutputManager creates a new StandardOutputManager given a logger instance
func (*StandardOutputManager) Flush ¶
func (s *StandardOutputManager) Flush() error
Flush writes the contents of the managers buffer to the console
func (*StandardOutputManager) Put ¶
func (s *StandardOutputManager) Put(cr CheckResult) error
Put puts the result of the check to the manager in the managers buffer
type TAPOutputManager ¶
type TAPOutputManager struct {
// contains filtered or unexported fields
}
TAPOutputManager formats its output in TAP format
func NewDefaultTAPOutputManager ¶
func NewDefaultTAPOutputManager() *TAPOutputManager
NewDefaultTAPOutputManager creates a new TAPOutputManager using the default logger
func NewTAPOutputManager ¶
func NewTAPOutputManager(l *log.Logger) *TAPOutputManager
NewTAPOutputManager creates a new TAPOutputManager with a given logger instance
func (*TAPOutputManager) Put ¶
func (t *TAPOutputManager) Put(cr CheckResult) error
Put puts the result of the check to the manager in the managers buffer
type TableOutputManager ¶
type TableOutputManager struct {
// contains filtered or unexported fields
}
TableOutputManager formats its output in a table
func NewDefaultTableOutputManager ¶
func NewDefaultTableOutputManager() *TableOutputManager
NewDefaultTableOutputManager creates a new TableOutputManager using standard out
func NewTableOutputManager ¶
func NewTableOutputManager(w io.Writer) *TableOutputManager
NewTableOutputManager creates a new TableOutputManager with a given Writer
func (*TableOutputManager) Flush ¶
func (t *TableOutputManager) Flush() error
Flush writes the contents of the managers buffer to the console
func (*TableOutputManager) Put ¶
func (t *TableOutputManager) Put(cr CheckResult) error
Put puts the result of the check to the manager in the managers buffer