Documentation ¶
Overview ¶
Package workflow defines the Role interface, along with tooling to build the control tree. A workflow is a tree of Roles, and it's loaded from Configuration with a combination of YAML unmarshaling and Go template execution.
Index ¶
- Constants
- func GetActiveTasks(r Role) task.Tasks
- func Graft(root *yaml.Node, path string, toAdd []byte, graftedName string) (out []byte, err error)
- func LeafWalk(root Role, do func(role Role))
- func LinkChildrenToParents(root Role)
- func LoadWorkflow(in []byte) (out yaml.Node, err error)
- func MakeDisabledRoleCallback(r Role) func(stage template.Stage, err error) error
- func RoleToYAML(input Role) ([]byte, error)
- func Walk(root Role, do func(role Role))
- func WrapConstraints(items constraint.Constraints) template.Fields
- type GetCurrentRunNumberFunc
- type GetEnvIdFunc
- type GetStringMapFunc
- type LoadSubworkflowFunc
- type ParentAdapter
- func (*ParentAdapter) CollectInboundChannels() []channel.Inbound
- func (*ParentAdapter) CollectOutboundChannels() []channel.Outbound
- func (p *ParentAdapter) GetCurrentRunNumber() uint32
- func (p *ParentAdapter) GetDefaults() gera.Map[string, string]
- func (p *ParentAdapter) GetEnvironmentId() uid.ID
- func (p *ParentAdapter) GetParent() Updatable
- func (*ParentAdapter) GetPath() string
- func (p *ParentAdapter) GetUserVars() gera.Map[string, string]
- func (p *ParentAdapter) GetVars() gera.Map[string, string]
- func (p *ParentAdapter) SendEvent(ev event.Event)
- func (p *ParentAdapter) SubscribeToStateChange(subscriptionId string, c chan sm.State)
- func (p *ParentAdapter) SubscribeToStatusChange(subscriptionId string, c chan task.Status)
- func (p *ParentAdapter) UnsubscribeFromStateChange(subscriptionId string)
- func (p *ParentAdapter) UnsubscribeFromStatusChange(subscriptionId string)
- type PublicUpdatable
- type Role
- func GetRoot(role Role) (root Role)
- func Load(workflowPath string, parent Updatable, taskManager *task.Manager, ...) (workflow Role, err error)
- func LoadDPL(tasks []*taskclass.Class, rootRoleName string, extraVarsMap map[string]string) (workflow Role, err error)
- func NewAggregatorRole(name string, roles []Role) (r Role)
- func NewCallRole(name string, traits task.Traits, funcCall string, returnVar string) (r Role)
- type SafeState
- type SafeStatus
- type SendEvents
- type Updatable
- type VarNode
Constants ¶
const ( PATH_SEPARATOR = "." PATH_SEPARATOR_RUNE = '.' )
Variables ¶
This section is empty.
Functions ¶
func GetActiveTasks ¶ added in v1.8.1
func Graft ¶ added in v0.17.0
Graft takes a root node, a path to a role in root, byte array with an existing role and appends this role asa child of the role in root where the path specifies.
func LinkChildrenToParents ¶ added in v1.8.0
func LinkChildrenToParents(root Role)
LinkChildrenToParents walks through the role tree and sets the correct parent for each child
func LoadWorkflow ¶ added in v0.17.0
func MakeDisabledRoleCallback ¶ added in v0.50.0
func RoleToYAML ¶ added in v0.17.0
RoleToYAML exists to avoid exporting aggregatorRole/iteratorRole. Simply put, this function is nothing but a wrapper which allows marshalling Roles outside the workflow package
func WrapConstraints ¶ added in v0.19.90
func WrapConstraints(items constraint.Constraints) template.Fields
Types ¶
type GetCurrentRunNumberFunc ¶ added in v0.20.0
type GetCurrentRunNumberFunc func() uint32
type GetEnvIdFunc ¶
type LoadSubworkflowFunc ¶ added in v0.21.80
type ParentAdapter ¶
type ParentAdapter struct { SendEvents SendEvents // contains filtered or unexported fields }
func NewParentAdapter ¶
func NewParentAdapter(getEnvId GetEnvIdFunc, getCurrentRunNumber GetCurrentRunNumberFunc, getDefaults GetStringMapFunc, getVars GetStringMapFunc, getUserVars GetStringMapFunc, SendEvents SendEvents) *ParentAdapter
func (*ParentAdapter) CollectInboundChannels ¶ added in v0.13.90
func (*ParentAdapter) CollectInboundChannels() []channel.Inbound
func (*ParentAdapter) CollectOutboundChannels ¶
func (*ParentAdapter) CollectOutboundChannels() []channel.Outbound
func (*ParentAdapter) GetCurrentRunNumber ¶ added in v0.20.0
func (p *ParentAdapter) GetCurrentRunNumber() uint32
func (*ParentAdapter) GetDefaults ¶ added in v0.12.90
func (p *ParentAdapter) GetDefaults() gera.Map[string, string]
func (*ParentAdapter) GetEnvironmentId ¶
func (p *ParentAdapter) GetEnvironmentId() uid.ID
func (*ParentAdapter) GetParent ¶
func (p *ParentAdapter) GetParent() Updatable
func (*ParentAdapter) GetPath ¶
func (*ParentAdapter) GetPath() string
func (*ParentAdapter) GetUserVars ¶ added in v0.12.90
func (p *ParentAdapter) GetUserVars() gera.Map[string, string]
func (*ParentAdapter) GetVars ¶ added in v0.12.90
func (p *ParentAdapter) GetVars() gera.Map[string, string]
func (*ParentAdapter) SendEvent ¶ added in v0.19.80
func (p *ParentAdapter) SendEvent(ev event.Event)
func (*ParentAdapter) SubscribeToStateChange ¶
func (p *ParentAdapter) SubscribeToStateChange(subscriptionId string, c chan sm.State)
func (*ParentAdapter) SubscribeToStatusChange ¶
func (p *ParentAdapter) SubscribeToStatusChange(subscriptionId string, c chan task.Status)
func (*ParentAdapter) UnsubscribeFromStateChange ¶
func (p *ParentAdapter) UnsubscribeFromStateChange(subscriptionId string)
func (*ParentAdapter) UnsubscribeFromStatusChange ¶
func (p *ParentAdapter) UnsubscribeFromStatusChange(subscriptionId string)
type PublicUpdatable ¶ added in v0.20.0
type Role ¶
type Role interface { VarNode GetParent() Updatable GetParentRole() Role GetRootRole() Role GetRoles() []Role GetPath() string GetName() string GetStatus() task.Status GetState() sm.State GetTasks() task.Tasks GetTaskClasses() []string GenerateTaskDescriptors() task.Descriptors ProcessTemplates(workflowRepo repos.IRepo, loadSubworkflow LoadSubworkflowFunc, baseConfigStack map[string]string) error GlobFilter(g glob.Glob) []Role SetRuntimeVar(key string, value string) SetRuntimeVars(kv map[string]string) DeleteRuntimeVar(key string) DeleteRuntimeVars(keys []string) GetHooksMapForTrigger(trigger string) callable.HooksMap GetAllHooks() callable.Hooks IsEnabled() bool GetCurrentRunNumber() uint32 ConsolidatedVarStack() (varStack map[string]string, err error) ConsolidatedVarMaps() (defaults, vars, userVars map[string]string, err error) GetEnvironmentId() uid.ID IsCritical() bool // contains filtered or unexported methods }
func Load ¶
func Load(workflowPath string, parent Updatable, taskManager *task.Manager, userProperties map[string]string, baseConfigStack map[string]string) (workflow Role, err error)
FIXME: workflowPath should be of type configuration.Path, not string
func NewAggregatorRole ¶ added in v1.14.0
type SafeStatus ¶
type SafeStatus struct {
// contains filtered or unexported fields
}