v1

package
v0.30.11 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	meta.Meta `json:",inline" yaml:",inline" hcl:",inline"`

	Insight *insight.Insight `json:"insight" yaml:"insight" hcl:"insight"`

	RegisterVariables  []Variable          `json:"registerVariables" yaml:"registerVariables" hcl:"registerVariables"`
	EvaluateConditions []EvaluateCondition `json:"evaluateConditions" yaml:"evaluateConditions" hcl:"evaluateConditions"`
}

type AndPredicate added in v0.25.0

type AndPredicate []Condition

func (*AndPredicate) Eval added in v0.25.0

func (c *AndPredicate) Eval(ref interface{}, data map[string]interface{}, err error) (bool, error)

type Condition

type Condition struct {
	meta.Meta   `json:",inline" yaml:",inline" hcl:",inline"`
	VariableRef string `json:"variableRef,omitempty" yaml:"variableRef,omitempty" hcl:"variableRef,omitempty"` // Should we use a meta.Ref here?

	// built-in
	Empty         *condition.Empty         `json:"empty,omitempty" yaml:"empty,omitempty" hcl:"empty,omitempty"`
	EvalCondition *condition.EvalCondition `json:"eval,omitempty" yaml:"eval,omitempty" hcl:"eval,omitempty"`
	NumberCompare *condition.NumberCompare `json:"numberCompare,omitempty" yaml:"numberCompare,omitempty" hcl:"numberCompare,omitempty"`
	RegexpMatch   *condition.RegexpMatch   `json:"regexpMatch,omitempty" yaml:"regexpMatch,omitempty" hcl:"regexpMatch,omitempty"`
	StringCompare *condition.StringCompare `json:"stringCompare,omitempty" yaml:"stringCompare,omitempty" hcl:"stringCompare,omitempty"`

	// predicates
	And *AndPredicate `json:"and,omitempty" yaml:"and,omitempty" hcl:"and,omitempty"`
	Or  *OrPredicate  `json:"or,omitempty" yaml:"or,omitempty" hcl:"or,omitempty"`
	Not *NotPredicate `json:"not,omitempty" yaml:"not,omitempty" hcl:"not,omitempty"`
}

func (*Condition) Eval

func (c *Condition) Eval(data map[string]interface{}) (bool, error)

func (*Condition) GetCondition added in v0.25.0

func (c *Condition) GetCondition() (condition.Interface, string, bool)

type EvaluateCondition added in v0.25.0

type EvaluateCondition struct {
	meta.Meta `json:",inline" yaml:",inline" hcl:",inline"`

	Condition      Condition        `json:"condition" yaml:"condition" hcl:"condition"`
	InsightOnError *insight.Insight `json:"insightOnError,omitempty" yaml:"insightOnError,omitempty" hcl:"insightOnError,omitempty"`
	InsightOnFalse *insight.Insight `json:"insightOnFalse,omitempty" yaml:"insightOnFalse,omitempty" hcl:"insightOnFalse,omitempty"`
}

type NotPredicate added in v0.25.0

type NotPredicate struct {
	Condition `json:",inline" yaml:",inline" hcl:",inline"`
}

func (*NotPredicate) Eval added in v0.25.0

func (c *NotPredicate) Eval(ref interface{}, data map[string]interface{}, err error) (bool, error)

type OrPredicate added in v0.25.0

type OrPredicate []Condition

func (*OrPredicate) Eval added in v0.25.0

func (c *OrPredicate) Eval(ref interface{}, data map[string]interface{}, err error) (bool, error)

type Variable added in v0.25.0

type Variable struct {
	meta.Meta `json:",inline" yaml:",inline" hcl:",inline"`

	// built-in
	CollectRef           *variable.CollectRef           `json:"collectRef,omitempty" yaml:"collectRef,omitempty" hcl:"collectRef,omitempty"`
	CoreReadFilePath     *variable.CoreReadFilePath     `json:"coreReadFilePath,omitempty" yaml:"coreReadFilePath,omitempty" hcl:"coreReadFilePath,omitempty"`
	CPUCores             *variable.CPUCores             `json:"cpuCores,omitempty" yaml:"cpuCores,omitempty" hcl:"cpuCores,omitempty"`
	Eval                 *variable.Eval                 `json:"eval,omitempty" yaml:"eval,omitempty" hcl:"eval,omitempty"`
	FileMatch            *variable.FileMatch            `json:"fileMatch,omitempty" yaml:"fileMatch,omitempty" hcl:"fileMatch,omitempty"`
	Loadavg              *variable.Loadavg              `json:"loadavg,omitempty" yaml:"loadavg,omitempty" hcl:"loadavg,omitempty"`
	Loadavg1             *variable.Loadavg1             `json:"loadavg1,omitempty" yaml:"loadavg1,omitempty" hcl:"loadavg1,omitempty"`
	Loadavg5             *variable.Loadavg5             `json:"loadavg5,omitempty" yaml:"loadavg5,omitempty" hcl:"loadavg5,omitempty"`
	Loadavg15            *variable.Loadavg15            `json:"loadavg15,omitempty" yaml:"loadavg15,omitempty" hcl:"loadavg15,omitempty"`
	MemoryUsageAvailable *variable.MemoryUsageAvailable `json:"memoryUsageAvailable,omitempty" yaml:"memoryUsageAvailable,omitempty" hcl:"memoryUsageAvailable,omitempty"`
	MemoryUsageTotal     *variable.MemoryUsageTotal     `json:"memoryUsageTotal,omitempty" yaml:"memoryUsageTotal,omitempty" hcl:"memoryUsageTotal,omitempty"`
	Os                   *variable.Os                   `json:"os,omitempty" yaml:"os,omitempty" hcl:"os,omitempty"`
	OsUptime             *variable.OsUptime             `json:"osUptime,omitempty" yaml:"osUptime,omitempty" hcl:"osUptime,omitempty"`
	WhichCloud           *variable.WhichCloud           `json:"whichCloud,omitempty" yaml:"whichCloud,omitempty" hcl:"whichCloud,omitempty"`
}

func (*Variable) GetVariable added in v0.25.0

func (v *Variable) GetVariable() (variable.Interface, string, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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