workflow

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: GPL-3.0 Imports: 25 Imported by: 0

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

View Source
const (
	PATH_SEPARATOR      = "."
	PATH_SEPARATOR_RUNE = '.'
)

Variables

This section is empty.

Functions

func Graft added in v0.17.0

func Graft(root *yaml.Node, path string, toAdd []byte, graftedName string) (out []byte, err error)

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 LoadWorkflow added in v0.17.0

func LoadWorkflow(in []byte) (out yaml.Node, err error)

func RoleToYAML added in v0.17.0

func RoleToYAML(input Role) ([]byte, error)

RoleToYAML exists to avoid exporting aggregatorRole/iteratorRole. Simply put, this function is nothing but a wrapper which allows marshalling Roles outside the workflow package

Types

type GetEnvIdFunc

type GetEnvIdFunc func() uid.ID

type GetStringMapFunc added in v0.12.90

type GetStringMapFunc func() gera.StringMap

type ParentAdapter

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

func NewParentAdapter

func NewParentAdapter(getEnvId GetEnvIdFunc,
	getDefaults GetStringMapFunc,
	getVars GetStringMapFunc,
	getUserVars GetStringMapFunc) *ParentAdapter

func (*ParentAdapter) CollectInboundChannels added in v0.13.90

func (*ParentAdapter) CollectInboundChannels() []channel.Inbound

func (*ParentAdapter) CollectOutboundChannels

func (*ParentAdapter) CollectOutboundChannels() []channel.Outbound

func (*ParentAdapter) GetDefaults added in v0.12.90

func (p *ParentAdapter) GetDefaults() gera.StringMap

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.StringMap

func (*ParentAdapter) GetVars added in v0.12.90

func (p *ParentAdapter) GetVars() gera.StringMap

func (*ParentAdapter) SubscribeToStateChange

func (p *ParentAdapter) SubscribeToStateChange(subscriptionId string, c chan task.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 Role

type Role interface {
	VarNode
	GetParent() Updatable
	GetParentRole() Role
	GetRoles() []Role
	GetPath() string
	GetName() string
	GetStatus() task.Status
	GetState() task.State
	GetTasks() task.Tasks
	GetTaskClasses() []string
	GenerateTaskDescriptors() task.Descriptors

	ProcessTemplates(workflowRepo *repos.Repo) error
	GlobFilter(g glob.Glob) []Role
	SetRuntimeVar(key string, value string)
	SetRuntimeVars(kv map[string]string)
	GetHooksForTrigger(trigger string) task.Tasks
	IsEnabled() bool
	// contains filtered or unexported methods
}

func Load

func Load(workflowPath string, parent Updatable, taskManager *task.Manager, userProperties map[string]string) (workflow Role, err error)

FIXME: workflowPath should be of type configuration.Path, not string

func LoadDPL added in v0.17.0

func LoadDPL(tasks []*task.Class, rootRoleName string, extraVarsMap map[string]string) (workflow Role, err error)

type SafeState

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

type SafeStatus

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

type Updatable

type Updatable interface {
	VarNode
	GetParent() Updatable

	GetEnvironmentId() uid.ID
	GetPath() string
	CollectOutboundChannels() []channel.Outbound
	CollectInboundChannels() []channel.Inbound
	// contains filtered or unexported methods
}

type VarNode added in v0.12.90

type VarNode interface {
	GetDefaults() gera.StringMap
	GetVars() gera.StringMap
	GetUserVars() gera.StringMap
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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