commands

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultCommand

func NewDefaultCommand() *cobra.Command

NewDefaultCommand creates the default command

func NewDefaultJSONOutputManager

func NewDefaultJSONOutputManager() *jsonOutputManager

func NewDefaultStdOutputManager

func NewDefaultStdOutputManager(color bool) *stdOutputManager

NewDefaultStdOutputManager instantiates a new instance of stdOutputManager using the default logger.

func NewDefaultTAPOutputManager

func NewDefaultTAPOutputManager() *tapOutputManager

NewDefaultTAPOutputManager instantiates a new instance of tapOutputManager using the default logger.

func NewDefaultTableOutputManager

func NewDefaultTableOutputManager() *tableOutputManager

NewDefaultTableOutputManager instantiates a new instance of tableOutputManager

func NewJSONOutputManager

func NewJSONOutputManager(l *log.Logger) *jsonOutputManager

func NewParseCommand

func NewParseCommand(ctx context.Context) *cobra.Command

NewParseCommand creates a parse command. This command can be used for printing structured inputs from unstructured configuration inputs.

func NewPullCommand

func NewPullCommand(ctx context.Context) *cobra.Command

NewPullCommand creates a new pull command to allow users to download individual policies

func NewPushCommand

func NewPushCommand(ctx context.Context, logger *log.Logger) *cobra.Command

NewPushCommand creates a new push command which allows users to push bundles to an OCI registry

func NewStdOutputManager

func NewStdOutputManager(l *log.Logger, color bool) *stdOutputManager

NewStdOutputManager constructs an instance of stdOutputManager given a logger instance.

func NewTAPOutputManager

func NewTAPOutputManager(l *log.Logger) *tapOutputManager

NewTAPOutputManager constructs an instance of stdOutputManager given a logger instance.

func NewTableOutputManager

func NewTableOutputManager(w io.Writer) *tableOutputManager

NewTableOutputManager constructs an instance of tableOutputManager given a io.Writer.

func NewTestCommand

func NewTestCommand(ctx context.Context) *cobra.Command

NewTestCommand creates a new test command

func NewVerifyCommand

func NewVerifyCommand(ctx context.Context) *cobra.Command

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
	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.

func GetResult

func GetResult(ctx context.Context, namespace string, input interface{}, compiler *ast.Compiler) (CheckResult, error)

GetResult returns the result of testing the structured data against their policies

type OutputManager

type OutputManager interface {
	Put(cr CheckResult) error
	Flush() error
}

OutputManager controls how results of the `ccheck` evaluation will be recorded and reported to the end user.

func GetOutputManager

func GetOutputManager() OutputManager

type Result

type Result struct {
	Message error
	Traces  []error
}

Result describes the result of a single rule evaluation.

Jump to

Keyboard shortcuts

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