types

package
v0.0.0-...-98ba599 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package types is a generated protocol buffer package.

It is generated from these files:

pkg/types/types.proto

It has these top-level messages:

Workflow
WorkflowSpec
WorkflowStatus
WorkflowInvocation
WorkflowInvocationSpec
WorkflowInvocationStatus
DependencyConfig
Task
TaskSpec
TaskStatus
TaskDependencyParameters
TaskInvocation
TaskInvocationSpec
TaskInvocationStatus
ObjectMetadata
Error
FnRef
TypedValueMap
TypedValueList

Index

Constants

View Source
const (
	InputMain    = "default"
	InputBody    = "body"
	InputHeaders = "headers"
	InputQuery   = "query"
	InputMethod  = "method"
	InputParent  = "_parent"

	WorkflowAPIVersion = "v1"

	TypeWorkflow   = "workflow"
	TypeInvocation = "invocation"
	TypeTaskRun    = "taskrun"
)

Types other than specified in protobuf

View Source
const (
	RuntimeDelimiter = "://"
)

Variables

View Source
var (
	ErrInvalidFnRef   = errors.New("invalid function reference")
	ErrFnRefNoRuntime = errors.New("fnref has empty runtime")
	ErrFnRefNoID      = errors.New("fnref has empty ID")
)
View Source
var TaskDependencyParameters_DependencyType_name = map[int32]string{
	0: "DATA",
	1: "CONTROL",
	2: "DYNAMIC_OUTPUT",
}
View Source
var TaskDependencyParameters_DependencyType_value = map[string]int32{
	"DATA":           0,
	"CONTROL":        1,
	"DYNAMIC_OUTPUT": 2,
}
View Source
var TaskInvocationStatus_Status_name = map[int32]string{
	0: "UNKNOWN",
	1: "SCHEDULED",
	2: "IN_PROGRESS",
	3: "SUCCEEDED",
	4: "FAILED",
	5: "ABORTED",
	6: "SKIPPED",
}
View Source
var TaskInvocationStatus_Status_value = map[string]int32{
	"UNKNOWN":     0,
	"SCHEDULED":   1,
	"IN_PROGRESS": 2,
	"SUCCEEDED":   3,
	"FAILED":      4,
	"ABORTED":     5,
	"SKIPPED":     6,
}
View Source
var TaskStatus_Status_name = map[int32]string{
	0: "STARTED",
	1: "READY",
	2: "FAILED",
}
View Source
var TaskStatus_Status_value = map[string]int32{
	"STARTED": 0,
	"READY":   1,
	"FAILED":  2,
}
View Source
var WorkflowInvocationStatus_Status_name = map[int32]string{
	0: "UNKNOWN",
	1: "SCHEDULED",
	2: "IN_PROGRESS",
	3: "SUCCEEDED",
	4: "FAILED",
	5: "ABORTED",
}
View Source
var WorkflowInvocationStatus_Status_value = map[string]int32{
	"UNKNOWN":     0,
	"SCHEDULED":   1,
	"IN_PROGRESS": 2,
	"SUCCEEDED":   3,
	"FAILED":      4,
	"ABORTED":     5,
}
View Source
var WorkflowStatus_Status_name = map[int32]string{
	0: "QUEUED",
	2: "READY",
	3: "FAILED",
	4: "DELETED",
}
View Source
var WorkflowStatus_Status_value = map[string]int32{
	"QUEUED":  0,
	"READY":   2,
	"FAILED":  3,
	"DELETED": 4,
}

Functions

func Input

func Input(val interface{}) map[string]*typedvalues.TypedValue

func SingleDefaultInput

func SingleDefaultInput(t *typedvalues.TypedValue) map[string]*typedvalues.TypedValue

func SingleInput

func SingleInput(key string, t *typedvalues.TypedValue) map[string]*typedvalues.TypedValue

func ValidateFnRef

func ValidateFnRef(fnref FnRef, allowEmptyNamespace bool) error

Types

type DependencyConfig

type DependencyConfig struct {
	// Dependencies for this task to execute
	Requires map[string]*TaskDependencyParameters `` /* 136-byte string literal not displayed */
	// Number of dependencies to wait for
	Await int32 `protobuf:"varint,2,opt,name=await" json:"await,omitempty"`
}

func (*DependencyConfig) Descriptor

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

func (*DependencyConfig) GetAwait

func (m *DependencyConfig) GetAwait() int32

func (*DependencyConfig) GetRequires

func (m *DependencyConfig) GetRequires() map[string]*TaskDependencyParameters

func (*DependencyConfig) ProtoMessage

func (*DependencyConfig) ProtoMessage()

func (*DependencyConfig) Reset

func (m *DependencyConfig) Reset()

func (*DependencyConfig) String

func (m *DependencyConfig) String() string

type Error

type Error struct {
	Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}

func (*Error) Descriptor

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

func (*Error) Error

func (m *Error) Error() string

func (*Error) GetMessage

func (m *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) Reset

func (m *Error) Reset()

func (*Error) String

func (m *Error) String() string

type FnRef

type FnRef struct {
	// Runtime is the Function Runtime environment (fnenv) that was used to resolve the function.
	Runtime string `protobuf:"bytes,2,opt,name=runtime" json:"runtime,omitempty"`
	// Namespace is the namespace of the fission function.
	Namespace string `protobuf:"bytes,3,opt,name=namespace" json:"namespace,omitempty"`
	// ID is the runtime-specific identifier of the function.
	ID string `protobuf:"bytes,4,opt,name=ID" json:"ID,omitempty"`
}

FnRef is an immutable, unique reference to a function on a specific function runtime environment.

The string representation (via String or Format): runtime://runtimeId

func NewFnRef

func NewFnRef(runtime, ns, id string) FnRef

func ParseFnRef

func ParseFnRef(s string) (FnRef, error)

func (*FnRef) Descriptor

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

func (FnRef) Format

func (m FnRef) Format() string

func (*FnRef) GetID

func (m *FnRef) GetID() string

func (*FnRef) GetNamespace

func (m *FnRef) GetNamespace() string

func (*FnRef) GetRuntime

func (m *FnRef) GetRuntime() string

func (FnRef) IsEmpty

func (m FnRef) IsEmpty() bool

func (FnRef) IsValid

func (m FnRef) IsValid() bool

func (*FnRef) ProtoMessage

func (*FnRef) ProtoMessage()

func (*FnRef) Reset

func (m *FnRef) Reset()

func (*FnRef) String

func (m *FnRef) String() string

type Inputs

type Inputs map[string]*typedvalues.TypedValue

type NamedTypedValue

type NamedTypedValue struct {
	typedvalues.TypedValue
	// contains filtered or unexported fields
}

type ObjectMetadata

type ObjectMetadata struct {
	// ID is the unique identifier, generated by the workflow engine
	Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	// Name is an optional human-readable name of the object.
	Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	// Created at contains the timestamp of when this object was created.
	// Typically the updatedAt field can be found in the status of the object.
	CreatedAt *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=createdAt" json:"createdAt,omitempty"`
	// Generation is a sequence identifier used and updated by the system to record the number of events or
	// changes applied to the object.
	Generation int64 `protobuf:"varint,4,opt,name=generation" json:"generation,omitempty"`
}

ObjectMetadata contains common metadata present for all objects in the workflow engine.

It closely follows the structure of Kubernetes' ObjectMetadata, leaving out the parameters that do not fit the workflow model, such as namespaces, clusters, finalizers, etc. In the future, if it fits the model, we may move to using Kubernetes' ObjectMetadata directly.

func NewObjectMetadata

func NewObjectMetadata(id string) *ObjectMetadata

func (*ObjectMetadata) Descriptor

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

func (*ObjectMetadata) GetCreatedAt

func (m *ObjectMetadata) GetCreatedAt() *google_protobuf.Timestamp

func (*ObjectMetadata) GetGeneration

func (m *ObjectMetadata) GetGeneration() int64

func (*ObjectMetadata) GetId

func (m *ObjectMetadata) GetId() string

func (*ObjectMetadata) GetName

func (m *ObjectMetadata) GetName() string

func (*ObjectMetadata) ProtoMessage

func (*ObjectMetadata) ProtoMessage()

func (*ObjectMetadata) Reset

func (m *ObjectMetadata) Reset()

func (*ObjectMetadata) String

func (m *ObjectMetadata) String() string

type Requires

type Requires map[string]*TaskDependencyParameters

func Require

func Require(s ...string) Requires

func (Requires) Add

func (r Requires) Add(s ...string) Requires

type Task

type Task struct {
	Metadata *ObjectMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"`
	Spec     *TaskSpec       `protobuf:"bytes,2,opt,name=spec" json:"spec,omitempty"`
	Status   *TaskStatus     `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"`
}

Task Model

func NewTask

func NewTask(id string, fn string) *Task

func (*Task) Descriptor

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

func (*Task) GetMetadata

func (m *Task) GetMetadata() *ObjectMetadata

func (*Task) GetSpec

func (m *Task) GetSpec() *TaskSpec

func (*Task) GetStatus

func (m *Task) GetStatus() *TaskStatus

func (*Task) ID

func (m *Task) ID() string

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) Reset

func (m *Task) Reset()

func (*Task) String

func (m *Task) String() string

type TaskDependencyParameters

type TaskDependencyParameters struct {
	Type  TaskDependencyParameters_DependencyType `protobuf:"varint,1,opt,name=type,enum=fission.workflows.types.TaskDependencyParameters_DependencyType" json:"type,omitempty"`
	Alias string                                  `protobuf:"bytes,2,opt,name=alias" json:"alias,omitempty"`
}

func (*TaskDependencyParameters) Descriptor

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

func (*TaskDependencyParameters) GetAlias

func (m *TaskDependencyParameters) GetAlias() string

func (*TaskDependencyParameters) GetType

func (*TaskDependencyParameters) ProtoMessage

func (*TaskDependencyParameters) ProtoMessage()

func (*TaskDependencyParameters) Reset

func (m *TaskDependencyParameters) Reset()

func (*TaskDependencyParameters) String

func (m *TaskDependencyParameters) String() string

type TaskDependencyParameters_DependencyType

type TaskDependencyParameters_DependencyType int32
const (
	TaskDependencyParameters_DATA           TaskDependencyParameters_DependencyType = 0
	TaskDependencyParameters_CONTROL        TaskDependencyParameters_DependencyType = 1
	TaskDependencyParameters_DYNAMIC_OUTPUT TaskDependencyParameters_DependencyType = 2
)

func (TaskDependencyParameters_DependencyType) EnumDescriptor

func (TaskDependencyParameters_DependencyType) EnumDescriptor() ([]byte, []int)

func (TaskDependencyParameters_DependencyType) String

type TaskInvocation

type TaskInvocation struct {
	Metadata *ObjectMetadata       `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"`
	Spec     *TaskInvocationSpec   `protobuf:"bytes,2,opt,name=spec" json:"spec,omitempty"`
	Status   *TaskInvocationStatus `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"`
}

Task Invocation Model

func (*TaskInvocation) Copy

func (m *TaskInvocation) Copy() *TaskInvocation

func (*TaskInvocation) Descriptor

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

func (*TaskInvocation) GetMetadata

func (m *TaskInvocation) GetMetadata() *ObjectMetadata

func (*TaskInvocation) GetSpec

func (m *TaskInvocation) GetSpec() *TaskInvocationSpec

func (*TaskInvocation) GetStatus

func (m *TaskInvocation) GetStatus() *TaskInvocationStatus

func (*TaskInvocation) ID

func (m *TaskInvocation) ID() string

func (*TaskInvocation) ProtoMessage

func (*TaskInvocation) ProtoMessage()

func (*TaskInvocation) Reset

func (m *TaskInvocation) Reset()

func (*TaskInvocation) String

func (m *TaskInvocation) String() string

func (*TaskInvocation) Task

func (m *TaskInvocation) Task() *Task

func (*TaskInvocation) Type

func (m *TaskInvocation) Type() string

type TaskInvocationSpec

type TaskInvocationSpec struct {
	// Id of the task to be invoked (no ambiguity at this point)
	FnRef *FnRef `protobuf:"bytes,1,opt,name=fnRef" json:"fnRef,omitempty"`
	// TaskId is the id of the task within the workflow
	//
	// Deprecated: use task.metadata.id instead to reference the workflow.
	TaskId string `protobuf:"bytes,2,opt,name=taskId" json:"taskId,omitempty"`
	// Inputs contain all inputs to the task invocation
	Inputs map[string]*fission_workflows_types.TypedValue `` /* 132-byte string literal not displayed */
	// InvocationID contains a reference to the workflow invocation of this task.
	InvocationId string `protobuf:"bytes,4,opt,name=invocationId" json:"invocationId,omitempty"`
	// Task contains a snapshot of the task that needs to be run.
	Task *Task `protobuf:"bytes,5,opt,name=task" json:"task,omitempty"`
	// Deadline is the timestamp before which the task invocation needs to be completed.
	//
	// The field is a hard deadline; any invocation exceeding the deadline specified here will be canceled.
	// Each task has a deadline. If no deadline is specified the task invocation inherits the deadline of the
	// invocation.
	Deadline *google_protobuf.Timestamp `protobuf:"bytes,6,opt,name=Deadline" json:"Deadline,omitempty"`
}

TaskInvocationSpec contains the complete specification of a workflow invocation.

func NewTaskInvocationSpec

func NewTaskInvocationSpec(invocation *WorkflowInvocation, task *Task, startAt time.Time) *TaskInvocationSpec

func (*TaskInvocationSpec) Descriptor

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

func (*TaskInvocationSpec) GetDeadline

func (m *TaskInvocationSpec) GetDeadline() *google_protobuf.Timestamp

func (*TaskInvocationSpec) GetFnRef

func (m *TaskInvocationSpec) GetFnRef() *FnRef

func (*TaskInvocationSpec) GetInputs

func (*TaskInvocationSpec) GetInvocationId

func (m *TaskInvocationSpec) GetInvocationId() string

func (*TaskInvocationSpec) GetTask

func (m *TaskInvocationSpec) GetTask() *Task

func (*TaskInvocationSpec) GetTaskId

func (m *TaskInvocationSpec) GetTaskId() string

func (*TaskInvocationSpec) ProtoMessage

func (*TaskInvocationSpec) ProtoMessage()

func (*TaskInvocationSpec) Reset

func (m *TaskInvocationSpec) Reset()

func (*TaskInvocationSpec) String

func (m *TaskInvocationSpec) String() string

type TaskInvocationStatus

type TaskInvocationStatus struct {
	Status        TaskInvocationStatus_Status         `protobuf:"varint,1,opt,name=status,enum=fission.workflows.types.TaskInvocationStatus_Status" json:"status,omitempty"`
	UpdatedAt     *google_protobuf.Timestamp          `protobuf:"bytes,2,opt,name=updatedAt" json:"updatedAt,omitempty"`
	Output        *fission_workflows_types.TypedValue `protobuf:"bytes,3,opt,name=output" json:"output,omitempty"`
	Error         *Error                              `protobuf:"bytes,4,opt,name=error" json:"error,omitempty"`
	OutputHeaders *fission_workflows_types.TypedValue `protobuf:"bytes,5,opt,name=outputHeaders" json:"outputHeaders,omitempty"`
}

func (*TaskInvocationStatus) Descriptor

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

func (TaskInvocationStatus) Finished

func (ti TaskInvocationStatus) Finished() bool

func (*TaskInvocationStatus) GetError

func (m *TaskInvocationStatus) GetError() *Error

func (*TaskInvocationStatus) GetOutput

func (*TaskInvocationStatus) GetOutputHeaders

func (*TaskInvocationStatus) GetStatus

func (*TaskInvocationStatus) GetUpdatedAt

func (m *TaskInvocationStatus) GetUpdatedAt() *google_protobuf.Timestamp

func (*TaskInvocationStatus) ProtoMessage

func (*TaskInvocationStatus) ProtoMessage()

func (*TaskInvocationStatus) Reset

func (m *TaskInvocationStatus) Reset()

func (*TaskInvocationStatus) String

func (m *TaskInvocationStatus) String() string

func (TaskInvocationStatus) Successful

func (ti TaskInvocationStatus) Successful() bool

type TaskInvocationStatus_Status

type TaskInvocationStatus_Status int32
const (
	TaskInvocationStatus_UNKNOWN     TaskInvocationStatus_Status = 0
	TaskInvocationStatus_SCHEDULED   TaskInvocationStatus_Status = 1
	TaskInvocationStatus_IN_PROGRESS TaskInvocationStatus_Status = 2
	TaskInvocationStatus_SUCCEEDED   TaskInvocationStatus_Status = 3
	TaskInvocationStatus_FAILED      TaskInvocationStatus_Status = 4
	TaskInvocationStatus_ABORTED     TaskInvocationStatus_Status = 5
	TaskInvocationStatus_SKIPPED     TaskInvocationStatus_Status = 6
)

func (TaskInvocationStatus_Status) EnumDescriptor

func (TaskInvocationStatus_Status) EnumDescriptor() ([]byte, []int)

func (TaskInvocationStatus_Status) String

type TaskSpec

type TaskSpec struct {
	// FunctionRef contains an identifier for the function.
	//
	// This possibly ambiguous reference will be resolved to a unambiguous function reference during the workflow
	// parsing. The result of this is found in the TaskStatus.FnRef.
	FunctionRef string                                         `protobuf:"bytes,1,opt,name=functionRef" json:"functionRef,omitempty"`
	Inputs      map[string]*fission_workflows_types.TypedValue `` /* 132-byte string literal not displayed */
	// Dependencies for this task to execute.
	Requires map[string]*TaskDependencyParameters `` /* 136-byte string literal not displayed */
	// Await signals the number of dependencies to wait for before this task can be started.
	Await int32 `protobuf:"varint,4,opt,name=await" json:"await,omitempty"`
	// Output transforms or overrides the output of the executed function.
	Output *fission_workflows_types.TypedValue `protobuf:"bytes,5,opt,name=output" json:"output,omitempty"`
	// OutputHeaders transforms or overrides the output headers of the executed function.
	OutputHeaders *fission_workflows_types.TypedValue `protobuf:"bytes,6,opt,name=outputHeaders" json:"outputHeaders,omitempty"`
	// Timeout specifies the the maximum runtime duration when executing this task.
	//
	// It overrides the deadline specified by the workflow invocation, but cannot exceed it. If set, this field will be
	// used in the task invocation spec to compute the deadline.
	Timeout *google_protobuf1.Duration `protobuf:"bytes,7,opt,name=timeout" json:"timeout,omitempty"`
}

A task is the primitive unit of a workflow, representing an action that needs to be performed in order to continue.

A task as a number of inputs and exactly two outputs Id is specified outside of TaskSpec

func NewTaskSpec

func NewTaskSpec(fn string) *TaskSpec

func (*TaskSpec) Descriptor

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

func (*TaskSpec) GetAwait

func (m *TaskSpec) GetAwait() int32

func (*TaskSpec) GetFunctionRef

func (m *TaskSpec) GetFunctionRef() string

func (*TaskSpec) GetInputs

func (m *TaskSpec) GetInputs() map[string]*fission_workflows_types.TypedValue

func (*TaskSpec) GetOutput

func (*TaskSpec) GetOutputHeaders

func (m *TaskSpec) GetOutputHeaders() *fission_workflows_types.TypedValue

func (*TaskSpec) GetRequires

func (m *TaskSpec) GetRequires() map[string]*TaskDependencyParameters

func (*TaskSpec) GetTimeout

func (m *TaskSpec) GetTimeout() *google_protobuf1.Duration

func (*TaskSpec) Input

func (m *TaskSpec) Input(key string, val *typedvalues.TypedValue) *TaskSpec

func (*TaskSpec) Parent

func (m *TaskSpec) Parent() (string, bool)

func (*TaskSpec) ProtoMessage

func (*TaskSpec) ProtoMessage()

func (*TaskSpec) Require

func (m *TaskSpec) Require(taskID string, opts ...*TaskDependencyParameters) *TaskSpec

func (*TaskSpec) Reset

func (m *TaskSpec) Reset()

func (*TaskSpec) String

func (m *TaskSpec) String() string

type TaskStatus

type TaskStatus struct {
	Status    TaskStatus_Status          `protobuf:"varint,1,opt,name=status,enum=fission.workflows.types.TaskStatus_Status" json:"status,omitempty"`
	UpdatedAt *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=updatedAt" json:"updatedAt,omitempty"`
	FnRef     *FnRef                     `protobuf:"bytes,3,opt,name=fnRef" json:"fnRef,omitempty"`
	Error     *Error                     `protobuf:"bytes,4,opt,name=error" json:"error,omitempty"`
}

func NewTaskStatus

func NewTaskStatus() *TaskStatus

func (*TaskStatus) Descriptor

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

func (*TaskStatus) GetError

func (m *TaskStatus) GetError() *Error

func (*TaskStatus) GetFnRef

func (m *TaskStatus) GetFnRef() *FnRef

func (*TaskStatus) GetStatus

func (m *TaskStatus) GetStatus() TaskStatus_Status

func (*TaskStatus) GetUpdatedAt

func (m *TaskStatus) GetUpdatedAt() *google_protobuf.Timestamp

func (*TaskStatus) ProtoMessage

func (*TaskStatus) ProtoMessage()

func (*TaskStatus) Reset

func (m *TaskStatus) Reset()

func (*TaskStatus) String

func (m *TaskStatus) String() string

type TaskStatus_Status

type TaskStatus_Status int32
const (
	TaskStatus_STARTED TaskStatus_Status = 0
	TaskStatus_READY   TaskStatus_Status = 1
	TaskStatus_FAILED  TaskStatus_Status = 2
)

func (TaskStatus_Status) EnumDescriptor

func (TaskStatus_Status) EnumDescriptor() ([]byte, []int)

func (TaskStatus_Status) String

func (x TaskStatus_Status) String() string

type Tasks

type Tasks map[string]*TaskSpec

type TypedValueList

type TypedValueList struct {
	Value []*fission_workflows_types.TypedValue `protobuf:"bytes,1,rep,name=Value" json:"Value,omitempty"`
}

Utility wrapper for a TypedValue list

func (*TypedValueList) Descriptor

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

func (*TypedValueList) GetValue

func (*TypedValueList) ProtoMessage

func (*TypedValueList) ProtoMessage()

func (*TypedValueList) Reset

func (m *TypedValueList) Reset()

func (*TypedValueList) String

func (m *TypedValueList) String() string

type TypedValueMap

type TypedValueMap struct {
	Value map[string]*fission_workflows_types.TypedValue `` /* 130-byte string literal not displayed */
}

Utility wrapper for a TypedValue map

func (*TypedValueMap) Descriptor

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

func (*TypedValueMap) GetValue

func (*TypedValueMap) ProtoMessage

func (*TypedValueMap) ProtoMessage()

func (*TypedValueMap) Reset

func (m *TypedValueMap) Reset()

func (*TypedValueMap) String

func (m *TypedValueMap) String() string

type Workflow

type Workflow struct {
	Metadata *ObjectMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"`
	Spec     *WorkflowSpec   `protobuf:"bytes,2,opt,name=spec" json:"spec,omitempty"`
	Status   *WorkflowStatus `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"`
}

Workflow Model

func NewWorkflow

func NewWorkflow(id string) *Workflow

func (*Workflow) Copy

func (m *Workflow) Copy() *Workflow

func (*Workflow) Descriptor

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

func (*Workflow) GetMetadata

func (m *Workflow) GetMetadata() *ObjectMetadata

func (*Workflow) GetSpec

func (m *Workflow) GetSpec() *WorkflowSpec

func (*Workflow) GetStatus

func (m *Workflow) GetStatus() *WorkflowStatus

func (*Workflow) ID

func (m *Workflow) ID() string

Workflow

func (*Workflow) ProtoMessage

func (*Workflow) ProtoMessage()

func (*Workflow) Reset

func (m *Workflow) Reset()

func (*Workflow) String

func (m *Workflow) String() string

func (*Workflow) Task

func (m *Workflow) Task(id string) (*Task, bool)

Note: this only retrieves the statically, top-level defined tasks TODO just store entire task in status

func (*Workflow) Tasks

func (m *Workflow) Tasks() map[string]*Task

func (*Workflow) Type

func (m *Workflow) Type() string

type WorkflowInvocation

type WorkflowInvocation struct {
	Metadata *ObjectMetadata           `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"`
	Spec     *WorkflowInvocationSpec   `protobuf:"bytes,2,opt,name=spec" json:"spec,omitempty"`
	Status   *WorkflowInvocationStatus `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"`
}

Workflow Invocation Model

func NewWorkflowInvocation

func NewWorkflowInvocation(wfID string, invocationID string, deadline time.Time) *WorkflowInvocation

func (*WorkflowInvocation) Copy

func (*WorkflowInvocation) Descriptor

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

func (*WorkflowInvocation) GetMetadata

func (m *WorkflowInvocation) GetMetadata() *ObjectMetadata

func (*WorkflowInvocation) GetSpec

func (*WorkflowInvocation) GetStatus

func (*WorkflowInvocation) ID

func (m *WorkflowInvocation) ID() string

func (*WorkflowInvocation) ProtoMessage

func (*WorkflowInvocation) ProtoMessage()

func (*WorkflowInvocation) Reset

func (m *WorkflowInvocation) Reset()

func (*WorkflowInvocation) String

func (m *WorkflowInvocation) String() string

func (*WorkflowInvocation) Task

func (m *WorkflowInvocation) Task(id string) (*Task, bool)

func (*WorkflowInvocation) TaskInvocation

func (m *WorkflowInvocation) TaskInvocation(id string) (*TaskInvocation, bool)

TODO how do we know which tasks are not being run

func (*WorkflowInvocation) TaskInvocations

func (m *WorkflowInvocation) TaskInvocations() map[string]*TaskInvocation

func (*WorkflowInvocation) Tasks

func (m *WorkflowInvocation) Tasks() map[string]*Task

Tasks gets all tasks in a workflow. This includes the dynamic tasks added during the invocation.

func (*WorkflowInvocation) Type

func (m *WorkflowInvocation) Type() string

func (*WorkflowInvocation) Workflow

func (m *WorkflowInvocation) Workflow() *Workflow

type WorkflowInvocationSpec

type WorkflowInvocationSpec struct {
	// WorkflowId contains a reference to the workflow that needs to be executed.
	//
	// Deprecated: use workflow.metadata.id instead to reference the workflow.
	WorkflowId string                                         `protobuf:"bytes,1,opt,name=workflowId" json:"workflowId,omitempty"`
	Inputs     map[string]*fission_workflows_types.TypedValue `` /* 132-byte string literal not displayed */
	// ParentId contains the id of the encapsulating workflow invocation.
	//
	// This used within the workflow engine; for user-provided workflow invocations the parentId is ignored.
	ParentId string `protobuf:"bytes,3,opt,name=parentId" json:"parentId,omitempty"`
	// Workflow contains the workflow that should be invoked.
	//
	// The workflow here is a snapshot; it should be considered immutable after added to the spec.
	Workflow *Workflow `protobuf:"bytes,4,opt,name=workflow" json:"workflow,omitempty"`
	// Deadline is the timestamp before which the workflow invocation needs to be completed.
	//
	// The field is a hard deadline; any invocation exceeding the deadline specified here will be canceled.
	// Each invocation has a deadline. If no deadline is provided Fission Workflows uses a default deadline (typically
	// 10 minutes).
	Deadline *google_protobuf.Timestamp `protobuf:"bytes,5,opt,name=Deadline" json:"Deadline,omitempty"`
}

WorkflowInvocationSpec contains the complete specification of a workflow invocation.

func NewWorkflowInvocationSpec

func NewWorkflowInvocationSpec(wfID string, deadline time.Time) *WorkflowInvocationSpec

func (*WorkflowInvocationSpec) Descriptor

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

func (*WorkflowInvocationSpec) GetDeadline

func (*WorkflowInvocationSpec) GetInputs

func (*WorkflowInvocationSpec) GetParentId

func (m *WorkflowInvocationSpec) GetParentId() string

func (*WorkflowInvocationSpec) GetWorkflow

func (m *WorkflowInvocationSpec) GetWorkflow() *Workflow

func (*WorkflowInvocationSpec) GetWorkflowId

func (m *WorkflowInvocationSpec) GetWorkflowId() string

func (*WorkflowInvocationSpec) ProtoMessage

func (*WorkflowInvocationSpec) ProtoMessage()

func (*WorkflowInvocationSpec) Reset

func (m *WorkflowInvocationSpec) Reset()

func (*WorkflowInvocationSpec) String

func (m *WorkflowInvocationSpec) String() string

type WorkflowInvocationStatus

type WorkflowInvocationStatus struct {
	Status    WorkflowInvocationStatus_Status     `protobuf:"varint,1,opt,name=status,enum=fission.workflows.types.WorkflowInvocationStatus_Status" json:"status,omitempty"`
	UpdatedAt *google_protobuf.Timestamp          `protobuf:"bytes,2,opt,name=updatedAt" json:"updatedAt,omitempty"`
	Tasks     map[string]*TaskInvocation          `` /* 130-byte string literal not displayed */
	Output    *fission_workflows_types.TypedValue `protobuf:"bytes,4,opt,name=output" json:"output,omitempty"`
	// In case the task ID also exists in the workflow spec, the dynamic task will be
	// used as an overlay over the static task.
	DynamicTasks  map[string]*Task                    `` /* 144-byte string literal not displayed */
	Error         *Error                              `protobuf:"bytes,6,opt,name=error" json:"error,omitempty"`
	OutputHeaders *fission_workflows_types.TypedValue `protobuf:"bytes,7,opt,name=outputHeaders" json:"outputHeaders,omitempty"`
}

func (*WorkflowInvocationStatus) Descriptor

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

func (WorkflowInvocationStatus) Finished

func (m WorkflowInvocationStatus) Finished() bool

Finished returns true if the invocation is in a terminal state.

func (*WorkflowInvocationStatus) GetDynamicTasks

func (m *WorkflowInvocationStatus) GetDynamicTasks() map[string]*Task

func (*WorkflowInvocationStatus) GetError

func (m *WorkflowInvocationStatus) GetError() *Error

func (*WorkflowInvocationStatus) GetOutput

func (*WorkflowInvocationStatus) GetOutputHeaders

func (*WorkflowInvocationStatus) GetStatus

func (*WorkflowInvocationStatus) GetTasks

func (m *WorkflowInvocationStatus) GetTasks() map[string]*TaskInvocation

func (*WorkflowInvocationStatus) GetUpdatedAt

func (*WorkflowInvocationStatus) ProtoMessage

func (*WorkflowInvocationStatus) ProtoMessage()

func (*WorkflowInvocationStatus) Reset

func (m *WorkflowInvocationStatus) Reset()

func (*WorkflowInvocationStatus) String

func (m *WorkflowInvocationStatus) String() string

func (WorkflowInvocationStatus) Successful

func (m WorkflowInvocationStatus) Successful() bool

func (*WorkflowInvocationStatus) ToTaskStatus

type WorkflowInvocationStatus_Status

type WorkflowInvocationStatus_Status int32
const (
	WorkflowInvocationStatus_UNKNOWN     WorkflowInvocationStatus_Status = 0
	WorkflowInvocationStatus_SCHEDULED   WorkflowInvocationStatus_Status = 1
	WorkflowInvocationStatus_IN_PROGRESS WorkflowInvocationStatus_Status = 2
	WorkflowInvocationStatus_SUCCEEDED   WorkflowInvocationStatus_Status = 3
	WorkflowInvocationStatus_FAILED      WorkflowInvocationStatus_Status = 4
	WorkflowInvocationStatus_ABORTED     WorkflowInvocationStatus_Status = 5
)

func (WorkflowInvocationStatus_Status) EnumDescriptor

func (WorkflowInvocationStatus_Status) EnumDescriptor() ([]byte, []int)

func (WorkflowInvocationStatus_Status) String

type WorkflowSpec

type WorkflowSpec struct {
	// apiVersion describes what version is of the workflow definition.
	// By default the workflow engine will assume the latest version to be used.
	ApiVersion string `protobuf:"bytes,1,opt,name=apiVersion" json:"apiVersion,omitempty"`
	// Tasks contains the specs of the tasks, with the key being the task id.
	//
	// Note: Dependency graph is build into the tasks.
	Tasks map[string]*TaskSpec `` /* 130-byte string literal not displayed */
	// From which task should the workflow return the output? Future: multiple? Implicit?
	OutputTask  string `protobuf:"bytes,3,opt,name=outputTask" json:"outputTask,omitempty"`
	Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"`
	// The UID that the workflow should have. Only use this in case you want to force a specific UID.
	ForceId string `protobuf:"bytes,5,opt,name=forceId" json:"forceId,omitempty"`
	// Name is solely for human-readablity
	Name string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"`
	// Internal indicates whether is a workflow should be visible to a human (default) or not.
	Internal bool `protobuf:"varint,7,opt,name=internal" json:"internal,omitempty"`
}

WorkflowSpec contains the definition of a workflow.

Ideally the source code (json, yaml) can be converted directly to this message. Naming, triggers and versioning of the workflow itself is out of the scope of this data structure, which is delegated to the user/system upon the creation of a workflow.

func NewWorkflowSpec

func NewWorkflowSpec() *WorkflowSpec

func (*WorkflowSpec) AddTask

func (m *WorkflowSpec) AddTask(id string, task *TaskSpec) *WorkflowSpec

func (*WorkflowSpec) Descriptor

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

func (*WorkflowSpec) GetApiVersion

func (m *WorkflowSpec) GetApiVersion() string

func (*WorkflowSpec) GetDescription

func (m *WorkflowSpec) GetDescription() string

func (*WorkflowSpec) GetForceId

func (m *WorkflowSpec) GetForceId() string

func (*WorkflowSpec) GetInternal

func (m *WorkflowSpec) GetInternal() bool

func (*WorkflowSpec) GetName

func (m *WorkflowSpec) GetName() string

func (*WorkflowSpec) GetOutputTask

func (m *WorkflowSpec) GetOutputTask() string

func (*WorkflowSpec) GetTasks

func (m *WorkflowSpec) GetTasks() map[string]*TaskSpec

func (*WorkflowSpec) ProtoMessage

func (*WorkflowSpec) ProtoMessage()

func (*WorkflowSpec) Reset

func (m *WorkflowSpec) Reset()

func (*WorkflowSpec) SetDescription

func (m *WorkflowSpec) SetDescription(s string) *WorkflowSpec

func (*WorkflowSpec) SetOutput

func (m *WorkflowSpec) SetOutput(taskID string) *WorkflowSpec

func (*WorkflowSpec) String

func (m *WorkflowSpec) String() string

func (*WorkflowSpec) TaskIds

func (m *WorkflowSpec) TaskIds() []string

func (*WorkflowSpec) TaskSpec

func (m *WorkflowSpec) TaskSpec(taskID string) *TaskSpec

type WorkflowStatus

type WorkflowStatus struct {
	Status    WorkflowStatus_Status      `protobuf:"varint,1,opt,name=status,enum=fission.workflows.types.WorkflowStatus_Status" json:"status,omitempty"`
	UpdatedAt *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=updatedAt" json:"updatedAt,omitempty"`
	// Tasks contains the status of the tasks, with the key being the task id.
	Tasks map[string]*Task `` /* 130-byte string literal not displayed */
	Error *Error           `protobuf:"bytes,4,opt,name=error" json:"error,omitempty"`
}

func NewWorkflowStatus

func NewWorkflowStatus() *WorkflowStatus

func (*WorkflowStatus) AddTask

func (m *WorkflowStatus) AddTask(id string, t *Task)

func (*WorkflowStatus) Descriptor

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

func (*WorkflowStatus) Failed

func (m *WorkflowStatus) Failed() bool

func (*WorkflowStatus) GetError

func (m *WorkflowStatus) GetError() *Error

func (*WorkflowStatus) GetStatus

func (m *WorkflowStatus) GetStatus() WorkflowStatus_Status

func (*WorkflowStatus) GetTasks

func (m *WorkflowStatus) GetTasks() map[string]*Task

func (*WorkflowStatus) GetUpdatedAt

func (m *WorkflowStatus) GetUpdatedAt() *google_protobuf.Timestamp

func (*WorkflowStatus) ProtoMessage

func (*WorkflowStatus) ProtoMessage()

func (*WorkflowStatus) Ready

func (m *WorkflowStatus) Ready() bool

func (*WorkflowStatus) Reset

func (m *WorkflowStatus) Reset()

func (*WorkflowStatus) String

func (m *WorkflowStatus) String() string

type WorkflowStatus_Status

type WorkflowStatus_Status int32
const (
	WorkflowStatus_QUEUED  WorkflowStatus_Status = 0
	WorkflowStatus_READY   WorkflowStatus_Status = 2
	WorkflowStatus_FAILED  WorkflowStatus_Status = 3
	WorkflowStatus_DELETED WorkflowStatus_Status = 4
)

func (WorkflowStatus_Status) EnumDescriptor

func (WorkflowStatus_Status) EnumDescriptor() ([]byte, []int)

func (WorkflowStatus_Status) String

func (x WorkflowStatus_Status) String() string

Directories

Path Synopsis
package typedvalues provides a data container for annotating, interpreting, and transferring arbitrary data.
package typedvalues provides a data container for annotating, interpreting, and transferring arbitrary data.
controlflow
Package controlflow adds support for workflows and tasks (together "flows") to TypedValues.
Package controlflow adds support for workflows and tasks (together "flows") to TypedValues.
httpconv
package httpconv provides methods for mapping TypedValues to and from HTTP requests and responses.
package httpconv provides methods for mapping TypedValues to and from HTTP requests and responses.
Validate package contains validation functions for the common structures used in the workflow engine, such as Workflows, Tasks, WorkflowInvocations, etc.
Validate package contains validation functions for the common structures used in the workflow engine, such as Workflows, Tasks, WorkflowInvocations, etc.

Jump to

Keyboard shortcuts

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