Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Edge ¶ added in v0.13.0
type Edge struct {
Src string `hash:"name:1" validate:"required"`
Dst string `hash:"name:2" validate:"required"`
}
Edge describes the instructions for the workflow to execute a task
type Node ¶ added in v0.13.0
type Node struct {
Key string `hash:"name:1" validate:"required"`
InstanceHash hash.Hash `hash:"name:2" validate:"required"`
TaskKey string `hash:"name:3" validate:"required,printascii"`
}
Node describes the instructions for the workflow to execute a task
type Predicate ¶ added in v0.13.0
type Predicate uint
Predicate is the type of conditions that can be applied in a filter of a workflow trigger
type Trigger ¶ added in v0.13.0
type Trigger struct {
InstanceHash hash.Hash `hash:"name:1" validate:"required"`
TaskKey string `hash:"name:2" validate:"printascii,required_without=EventKey"`
EventKey string `hash:"name:3" validate:"printascii,required_without=TaskKey"`
Filters TriggerFilters `hash:"name:4" validate:"dive,required"`
NodeKey string `hash:"name:5" validate:"required"`
}
Trigger is an event that triggers a workflow
type TriggerFilter ¶ added in v0.13.0
type TriggerFilter struct {
Key string `hash:"name:1" validate:"required,printascii"`
Predicate Predicate `hash:"name:2" validate:"required"`
Value interface{} `hash:"name:3"`
}
TriggerFilter is the filter definition that can be applied to a workflow trigger
func (*TriggerFilter) Match ¶ added in v0.13.0
func (f *TriggerFilter) Match(inputs map[string]interface{}) bool
Match returns true the current filter matches the given data
type TriggerFilters ¶ added in v0.13.0
type TriggerFilters []*TriggerFilter
TriggerFilters is a list of filters to apply
func (TriggerFilters) Match ¶ added in v0.13.0
func (f TriggerFilters) Match(data map[string]interface{}) bool
Match returns true if the data match the current list of filters
type Workflow ¶
type Workflow struct {
Hash hash.Hash `hash:"-" validate:"required"`
Key string `hash:"name:1" validate:"required"`
Trigger Trigger `hash:"name:2" validate:"required"`
Nodes []Node `hash:"name:3" validate:"dive,required"`
Edges []Edge `hash:"name:4" validate:"dive,required"`
}
Workflow describes a workflow of a service
func (Workflow) ChildrenIDs ¶ added in v0.13.0
ChildrenIDs returns the list of node IDs with a dependency to the current node
func (Workflow) FindNode ¶ added in v0.13.0
FindNode returns the node matching the key in parameter or an error if not found