Documentation ¶
Overview ¶
Package controlflow adds support for workflows and tasks (together "flows") to TypedValues.
With the workflow engine supporting dynamic tasks (tasks outputting other tasks or workflows) this package offers a useful abstraction of this mechanism in the form of a Flow. A flow is either a Workflow or Task, and is (like a task or workflow) wrappable into a TypedValue.
Package controlflow is a generated protocol buffer package.
It is generated from these files:
pkg/types/typedvalues/controlflow/flow.proto
It has these top-level messages:
Flow
Index ¶
- Variables
- func IsControlFlow(tv *typedvalues.TypedValue) bool
- func ResolveTaskOutput(taskID string, invocation *types.WorkflowInvocation) *typedvalues.TypedValue
- func ResolveTaskOutputHeaders(taskID string, invocation *types.WorkflowInvocation) *typedvalues.TypedValue
- func UnwrapTask(tv *typedvalues.TypedValue) (*types.TaskSpec, error)
- func UnwrapWorkflow(tv *typedvalues.TypedValue) (*types.WorkflowSpec, error)
- type Flow
- func (m *Flow) ApplyTask(fn func(t *types.TaskSpec))
- func (m *Flow) ApplyWorkflow(fn func(t *types.WorkflowSpec))
- func (m *Flow) Clone() *Flow
- func (*Flow) Descriptor() ([]byte, []int)
- func (m *Flow) GetTask() *fission_workflows_types1.TaskSpec
- func (m *Flow) GetWorkflow() *fission_workflows_types1.WorkflowSpec
- func (m *Flow) Input(key string, i typedvalues.TypedValue)
- func (m *Flow) IsEmpty() bool
- func (m *Flow) Proto() proto.Message
- func (*Flow) ProtoMessage()
- func (m *Flow) Reset()
- func (m *Flow) String() string
- func (m *Flow) Type() FlowType
- type FlowType
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyFlow = errors.New("flow is empty") ErrNotAFlow = errors.New("value is not a flow") )
Functions ¶
func IsControlFlow ¶
func IsControlFlow(tv *typedvalues.TypedValue) bool
func ResolveTaskOutput ¶
func ResolveTaskOutput(taskID string, invocation *types.WorkflowInvocation) *typedvalues.TypedValue
TODO move to more appropriate package
func ResolveTaskOutputHeaders ¶
func ResolveTaskOutputHeaders(taskID string, invocation *types.WorkflowInvocation) *typedvalues.TypedValue
func UnwrapTask ¶
func UnwrapTask(tv *typedvalues.TypedValue) (*types.TaskSpec, error)
func UnwrapWorkflow ¶
func UnwrapWorkflow(tv *typedvalues.TypedValue) (*types.WorkflowSpec, error)
Types ¶
type Flow ¶
type Flow struct { Workflow *fission_workflows_types1.WorkflowSpec `protobuf:"bytes,1,opt,name=workflow" json:"workflow,omitempty"` Task *fission_workflows_types1.TaskSpec `protobuf:"bytes,2,opt,name=task" json:"task,omitempty"` }
Flow is a generic data type to provide a common API to working with dynamic tasks and workflows If a flow contains both a task and a workflow, behavior is non-standard, but should in principle default to the task.
func FlowInterface ¶
func FlowWorkflow ¶
func FlowWorkflow(workflow *types.WorkflowSpec) *Flow
func UnwrapControlFlow ¶
func UnwrapControlFlow(tv *typedvalues.TypedValue) (*Flow, error)
func (*Flow) ApplyWorkflow ¶
func (m *Flow) ApplyWorkflow(fn func(t *types.WorkflowSpec))
func (*Flow) Descriptor ¶
func (*Flow) GetTask ¶
func (m *Flow) GetTask() *fission_workflows_types1.TaskSpec
func (*Flow) GetWorkflow ¶
func (m *Flow) GetWorkflow() *fission_workflows_types1.WorkflowSpec
func (*Flow) Input ¶
func (m *Flow) Input(key string, i typedvalues.TypedValue)
func (*Flow) ProtoMessage ¶
func (*Flow) ProtoMessage()