common

package
v0.10.10 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Overview

This package defines the intermediate layer that the compiler builds and transformers accept.

Index

Constants

View Source
const (
	StartNodeID = "start-node"
	EndNodeID   = "end-node"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdjacencyList

type AdjacencyList map[string]IdentifierSet

Defines a string adjacency list.

func (AdjacencyList) ToMapOfLists

func (l AdjacencyList) ToMapOfLists() map[string][]Identifier

Converts the sets in the adjacency list to sorted arrays.

type Empty

type Empty struct{}

type Identifier

type Identifier = core.Identifier

type IdentifierSet

type IdentifierSet map[string]Identifier

func NewIdentifierSet

func NewIdentifierSet(items ...Identifier) IdentifierSet

NewString creates a String from a list of values.

func (IdentifierSet) Delete

func (s IdentifierSet) Delete(items ...Identifier)

Delete removes all items from the set.

func (IdentifierSet) Has

func (s IdentifierSet) Has(item Identifier) bool

Has returns true if and only if item is contained in the set.

func (IdentifierSet) HasAll

func (s IdentifierSet) HasAll(items ...Identifier) bool

HasAll returns true if and only if all items are contained in the set.

func (IdentifierSet) HasAny

func (s IdentifierSet) HasAny(items ...Identifier) bool

HasAny returns true if any items are contained in the set.

func (IdentifierSet) Insert

func (s IdentifierSet) Insert(items ...Identifier)

Insert adds items to the set.

func (IdentifierSet) List

func (s IdentifierSet) List() []Identifier

List returns the contents as a sorted Identifier slice.

type InterfaceProvider

type InterfaceProvider interface {
	GetID() *core.Identifier
	GetExpectedInputs() *core.ParameterMap
	GetExpectedOutputs() *core.VariableMap
}

type LaunchPlanID

type LaunchPlanID = Identifier

type Node

type Node interface {
	GetId() NodeID
	GetInterface() *core.TypedInterface
	GetInputs() []*core.Binding
	GetWorkflowNode() *core.WorkflowNode
	GetOutputAliases() []*core.Alias
	GetUpstreamNodeIds() []string
	GetCoreNode() *core.Node
	GetBranchNode() *core.BranchNode
	GetTaskNode() *core.TaskNode
	GetMetadata() *core.NodeMetadata
	GetTask() Task
	GetSubWorkflow() Workflow
}

An immutable Node that represents the final output of the compiler.

type NodeBuilder

type NodeBuilder interface {
	Node
	SetID(id string)
	SetInterface(iface *core.TypedInterface)
	SetInputs(inputs []*core.Binding)
	SetSubWorkflow(wf Workflow)
	SetTask(task Task)
}

A mutable node used during the build of the intermediate layer.

type NodeID

type NodeID = string

type NodeIndex

type NodeIndex map[NodeID]NodeBuilder

Defines an index of nodebuilders based on the id.

func NewNodeIndex

func NewNodeIndex(nodes ...NodeBuilder) NodeIndex

Creates a new NodeIndex

type StringAdjacencyList

type StringAdjacencyList map[string]sets.String

type Task

type Task interface {
	GetID() TaskID
	GetCoreTask() *core.TaskTemplate
	GetInterface() *core.TypedInterface
}

An immutable task that represents the final output of the compiler.

type TaskID

type TaskID = Identifier

type TaskIDKey

type TaskIDKey = string

type TaskIndex

type TaskIndex map[TaskIDKey]Task

Defines an index of tasks based on the id.

func NewTaskIndex

func NewTaskIndex(tasks ...Task) TaskIndex

Creates a new TaskIndex.

type Workflow

type Workflow interface {
	GetNode(id NodeID) (node NodeBuilder, found bool)
	GetTask(id TaskID) (task Task, found bool)
	GetLaunchPlan(id LaunchPlanID) (wf InterfaceProvider, found bool)
	GetSubWorkflow(id WorkflowID) (wf *core.CompiledWorkflow, found bool)
	GetCompiledSubWorkflow(id WorkflowID) (wf *core.CompiledWorkflow, found bool)
	GetCoreWorkflow() *core.CompiledWorkflow
	GetFailureNode() Node
	GetNodes() NodeIndex
	GetTasks() TaskIndex
	GetDownstreamNodes() StringAdjacencyList
	GetUpstreamNodes() StringAdjacencyList
}

An immutable workflow that represents the final output of the compiler.

type WorkflowBuilder

type WorkflowBuilder interface {
	Workflow
	StoreCompiledSubWorkflow(id WorkflowID, compiledWorkflow *core.CompiledWorkflow)
	AddExecutionEdge(nodeFrom, nodeTo NodeID)
	AddNode(n NodeBuilder, errs errors.CompileErrors) (node NodeBuilder, ok bool)
	ValidateWorkflow(fg *core.CompiledWorkflow, errs errors.CompileErrors) (Workflow, bool)
	NewNodeBuilder(n *core.Node) NodeBuilder
}

A mutable workflow used during the build of the intermediate layer.

type WorkflowID

type WorkflowID = Identifier

type WorkflowIDKey

type WorkflowIDKey = string

type WorkflowIndex

type WorkflowIndex map[WorkflowIDKey]*core.CompiledWorkflow

func NewWorkflowIndex

func NewWorkflowIndex(workflows []*core.CompiledWorkflow, errs errors.CompileErrors) (index WorkflowIndex, ok bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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