transcons

package
v0.0.0-...-d2d06f5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conditions

type Conditions struct {
	Tcs []TransCon
}

Conditions is a collection of state transition conditions

func (Conditions) Evaluate

func (c Conditions) Evaluate(ctx context.Context, result results.Result) results.Result

Evaluate 's a results against ALL conditions. Returns after the first failure

type IntEqual

type IntEqual struct {
	UsingProperty string `mapstructure:"using_property"`
	ToEqual       int    `mapstructure:"to_equal"`
	Type          string
}

IntEqual contains fields to compare as integers

func (IntEqual) Evaluate

func (ie IntEqual) Evaluate(ctx context.Context, r results.Result) results.Result

Evaluate compares a result as an integer, to a configured property

type Registry

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

Registry contains a map of string identifiers to initializer functions

func NewRegistry

func NewRegistry() (Registry, error)

NewRegistry creates a registry of all available assertions

func (Registry) Load

func (r Registry) Load(tcm map[string]interface{}) (TransCon, error)

Load a registry based on a type

type StringEqual

type StringEqual struct {
	UsingProperty string `mapstructure:"using_property"`
	ToEqual       string `mapstructure:"to_equal"`

	Type string
}

StringEqual stores property and value to assert on

func (StringEqual) Evaluate

func (se StringEqual) Evaluate(ctx context.Context, r results.Result) results.Result

Evaluate compares a property of a result to a value, as a string

type Subprocess

type Subprocess struct {
	UsingProperty string `mapstructure:"using_property"`
	ToEqual       string `mapstructure:"to_equal"`

	CommandName string `mapstructure:"command_name"`
	Args        []string
	Type        string
}

Subprocess assertion

func (Subprocess) Evaluate

func (s Subprocess) Evaluate(ctx context.Context, r results.Result) results.Result

Evaluate 's a result using a shell subprocess

type TransCon

type TransCon interface {
	Evaluate(ctx context.Context, result results.Result) results.Result
}

TransCon interface for evaluating state transition conditions

func NewIntEqualFromMap

func NewIntEqualFromMap(m map[string]interface{}) (TransCon, error)

NewIntEqualFromMap initializes a IntEqual struct from generic map

func NewStringEqualFromMap

func NewStringEqualFromMap(m map[string]interface{}) (TransCon, error)

NewStringEqualFromMap initializes StringEqual from generic map

func NewSubprocessFromMap

func NewSubprocessFromMap(m map[string]interface{}) (TransCon, error)

NewSubprocessFromMap initializes a subprocess from a generica map

Jump to

Keyboard shortcuts

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