controlflow

package
v0.0.0-...-0f8ae5d Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyFlow = errors.New("flow is empty")
	ErrNotAFlow  = errors.New("value is not a flow")
)
View Source
var (
	TypeTask         string
	TypeWorkflow     string
	TypeFlow         string
	FlowTypeTask     FlowType
	FlowTypeWorkflow FlowType
	FlowTypeNone     FlowType
	Types            []string
)

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 FlowInterface(i interface{}) (*Flow, error)

func FlowTask

func FlowTask(task *types.TaskSpec) *Flow

func FlowWorkflow

func FlowWorkflow(workflow *types.WorkflowSpec) *Flow

func UnwrapControlFlow

func UnwrapControlFlow(tv *typedvalues.TypedValue) (*Flow, error)

func (*Flow) ApplyTask

func (m *Flow) ApplyTask(fn func(t *types.TaskSpec))

func (*Flow) ApplyWorkflow

func (m *Flow) ApplyWorkflow(fn func(t *types.WorkflowSpec))

func (*Flow) Clone

func (m *Flow) Clone() *Flow

func (*Flow) Descriptor

func (*Flow) Descriptor() ([]byte, []int)

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) IsEmpty

func (m *Flow) IsEmpty() bool

func (*Flow) Proto

func (m *Flow) Proto() proto.Message

func (*Flow) ProtoMessage

func (*Flow) ProtoMessage()

func (*Flow) Reset

func (m *Flow) Reset()

func (*Flow) String

func (m *Flow) String() string

func (*Flow) Type

func (m *Flow) Type() FlowType

type FlowType

type FlowType string

Jump to

Keyboard shortcuts

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