results

package
v0.1.8-rc Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	ID      string
	Value   interface{}
	Package string
}

Result holds the information about the result of a check

func (*Result) IsFailureState

func (r *Result) IsFailureState() bool

IsFailureState returns true if Value is boolean and it is false.

func (*Result) IsSuccessState

func (r *Result) IsSuccessState() bool

IsSuccessState returns true if Value is boolean and it is true.

type ResultCollection

type ResultCollection []*Result

ResultCollection is a collection of Result

func NewResultCollection

func NewResultCollection() *ResultCollection

NewResultCollection returns an empty ResultCollection.

func NewResultCollectionFromRegoResultSet

func NewResultCollectionFromRegoResultSet(rs *rego.ResultSet) (*ResultCollection, error)

NewResultCollectionFromRegoResultSet creates a new ResultCollection from a rego.ResultSet.

func Parse

func Parse(rawResult []byte) (*ResultCollection, error)

Parse takes the raw result of evaluating a set of rego rules in preflight and returns a ResultCollection collection.

func (*ResultCollection) Add

func (r *ResultCollection) Add(rr []*Result)

Add adds a slice of results to the collection.

func (*ResultCollection) ByID

func (r *ResultCollection) ByID() map[string]*Result

ByID returns a map of results by ID.

func (*ResultCollection) ListFailing

func (r *ResultCollection) ListFailing() []*Result

ListFailing returns a subset of the results that have failed.

func (*ResultCollection) ListPassing

func (r *ResultCollection) ListPassing() []*Result

ListPassing returns a subset of the results that have passed.

func (*ResultCollection) Raw added in v0.1.9

func (r *ResultCollection) Raw() []*Result

func (*ResultCollection) Serialize

func (r *ResultCollection) Serialize(w io.Writer) error

Serialize serializes a ResultCollection into a JSON representation and writes it.

Jump to

Keyboard shortcuts

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