runtime

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuleUnknown = iota
	RulePassed
	RuleFailed
	RuleWarning
	RuleDisabled
	RuleMisconfigured
	RuleConfigured
)

Variables

This section is empty.

Functions

func Run

func Run(options Options)

Types

type CiEvaluator added in v0.8.0

type CiEvaluator struct {
	Rules            []CiRule
	Results          map[string]RuleResult
	Tally            ResultTally
	Pass             bool
	Misconfigured    bool
	InefficientFiles []ReferenceFile
}

func NewCiEvaluator added in v0.8.0

func NewCiEvaluator(config *viper.Viper) *CiEvaluator

func (*CiEvaluator) Evaluate added in v0.8.0

func (ci *CiEvaluator) Evaluate(analysis *image.AnalysisResult) bool

func (*CiEvaluator) Report added in v0.8.0

func (ci *CiEvaluator) Report()

type CiRule added in v0.8.0

type CiRule interface {
	Key() string
	Configuration() string
	Validate() error
	Evaluate(*image.AnalysisResult) (RuleStatus, string)
}

type GenericCiRule added in v0.8.0

type GenericCiRule struct {
	// contains filtered or unexported fields
}

func (*GenericCiRule) Configuration added in v0.8.0

func (rule *GenericCiRule) Configuration() string

func (*GenericCiRule) Evaluate added in v0.8.0

func (rule *GenericCiRule) Evaluate(result *image.AnalysisResult) (RuleStatus, string)

func (*GenericCiRule) Key added in v0.8.0

func (rule *GenericCiRule) Key() string

func (*GenericCiRule) Validate added in v0.8.0

func (rule *GenericCiRule) Validate() error

type Options

type Options struct {
	Ci         bool
	ImageId    string
	ExportFile string
	CiConfig   *viper.Viper
	BuildArgs  []string
}

type ReferenceFile added in v0.8.0

type ReferenceFile struct {
	References int    `json:"count"`
	SizeBytes  uint64 `json:"sizeBytes"`
	Path       string `json:"file"`
}

type ResultTally added in v0.8.0

type ResultTally struct {
	Pass  int
	Fail  int
	Skip  int
	Warn  int
	Total int
}

type RuleResult added in v0.8.0

type RuleResult struct {
	// contains filtered or unexported fields
}

type RuleStatus added in v0.8.0

type RuleStatus int

func (RuleStatus) String added in v0.8.0

func (status RuleStatus) String() string

Jump to

Keyboard shortcuts

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