state

package
v0.0.0-...-9050134 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExitCondition

type ExitCondition struct {
	Codes  []int  `json:codes`
	Status string `json:status`
}

func (*ExitCondition) Handle

func (cond *ExitCondition) Handle(command *exec.Cmd, results chan<- error, stop <-chan bool, logger *log.Logger)

type FileMonitorCondition

type FileMonitorCondition struct {
	File   string         `json:"file"`
	Regex  *regexp.Regexp `json:"regex"`
	Status string         `json:"status"`
}

func (*FileMonitorCondition) Handle

func (monitor *FileMonitorCondition) Handle(results chan<- error, stop <-chan bool, logger *log.Logger)

handleFile handler for actual files

func (*FileMonitorCondition) UnmarshalJSON

func (monitor *FileMonitorCondition) UnmarshalJSON(b []byte) error

type OutputCondition

type OutputCondition struct {
	Source string         `json:"source"`
	Regex  *regexp.Regexp `json:"regex"`
	Status string         `json:"status"`
}

func (*OutputCondition) Handle

func (monitor *OutputCondition) Handle(logLine string, results chan<- error, stop <-chan bool, logger *log.Logger)

Handle will handle the output condition. This handler is different than the ones for the other conditions in/ that it expects a different process to manage the streams.

func (*OutputCondition) UnmarshalJSON

func (monitor *OutputCondition) UnmarshalJSON(b []byte) error

type Result

type Result struct {
	Error   error
	Success bool
}

Result holds information about the result of a state condition

type StateConditions

type StateConditions struct {
	Exit         *ExitCondition         `json:"exit"`
	Timeout      *TimeoutCondition      `json:"timeout"`
	FileMonitors []FileMonitorCondition `json:"filemonitor"`
	Outputs      []OutputCondition      `json:"output"`
}

StateCondition holds information about a specific state condition, and also functions to use that state condition

func (*StateConditions) Count

func (state *StateConditions) Count() int

Count returns the total number of state conditions we have

type TimeoutCondition

type TimeoutCondition struct {
	Duration int64  `json:duration`
	Status   string `json:status`
}

func (*TimeoutCondition) Handle

func (cond *TimeoutCondition) Handle(results chan<- error, stop <-chan bool, logger *log.Logger)

Jump to

Keyboard shortcuts

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