Documentation ¶
Index ¶
Constants ¶
const ( // SubTagGood the tag to be used on events who's result is good SubTagGood = "good" // SubTagBad the tag to be used on events who's result is bad SubTagBad = "bad" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Common commonConfig // the list of flow configurations Flows []*Flow }
Config is the set of nodes and rules
func ParseYAML ¶
ParseYAML takes a YAML input as a byte array and returns a Config object or an error
func (*Config) Defaults ¶
func (c *Config) Defaults()
Defaults ensures some sensible defaults have been set up
func (*Config) FindFlowsByTriggers ¶
func (c *Config) FindFlowsByTriggers(triggerType string, flow FlowRef, opts nt.Opts) map[FlowRef]FoundFlow
FindFlowsByTriggers finds all flows where its subs match the given params
func (*Config) LatestFlow ¶
LatestFlow returns the flow config matching the id with the highest version
type Flow ¶
type Flow struct { ID string // url friendly ID - computed from the name if not given Ver int // flow version, together with an ID form a global compound unique key // FlowFile is a path to a config file describing the Tasks. // It can be a path to a file in a git repo e.g. git@github.com:floeit/floe.git/build/FLOE.yaml // or a local file e.g. file:./foo-bar/floe.yaml // a FlowFile may override any setting from the flows defined in the main config file, but it // does not make much sense that they override the Triggers. FlowFile string `yaml:"flow-file"` Name string // human friendly name ReuseSpace bool `yaml:"reuse-space"` // if true then will use the single workspace and will mutex with other instances of this Flow HostTags []string `yaml:"host-tags"` // tags that must match the tags on the host ResourceTags []string `yaml:"resource-tags"` // tags that if any flow is running with any matching tags then don't launch Env []string // key=value environment variables with // Triggers are the node types that define how a run is triggered for this flow. Triggers []*node // The things to do once a trigger has started this flow Tasks []*node }
Flow is a serialisable Flow Config, a definition of a flow. It is uniquely identified by an ID and Version.
func (*Flow) Graph ¶
Graph returns an array representing levels in the flow 0 being the trigger events and the end events having the highest number
func (*Flow) Load ¶
Load looks at the FlowFile and loads in the flow from that reference overriding any pre-existing settings, except triggers.
type FlowRef ¶
FlowRef is a reference that uniquely identifies a flow
type FoundFlow ¶
type FoundFlow struct { // Ref constructed from the Flow Ref FlowRef // Matched is whatever node cause this flow to be found. It is either the trigger node that // matched the criteria to have found the flow and node, or a list of nodes that matched the // event that Matched *node // the full Flow definition *Flow }
FoundFlow is a struct containing a Flow and trigger that matched this flow. It can be used to decide on the best host to use to run this Flow.