types

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContextKeyMetadata is key that refer to application metadata.
	ContextKeyMetadata = "metadata__"
	// ContextPrefixFailedTimes is the prefix that refer to the failed times of the step in workflow context config map.
	ContextPrefixFailedTimes = "failed_times"
	// ContextPrefixBackoffTimes is the prefix that refer to the backoff times in workflow context config map.
	ContextPrefixBackoffTimes = "backoff_times"
	// ContextPrefixBackoffReason is the prefix that refer to the current backoff reason in workflow context config map
	ContextPrefixBackoffReason = "backoff_reason"
	// ContextKeyLastExecuteTime is the key that refer to the last execute time in workflow context config map.
	ContextKeyLastExecuteTime = "last_execute_time"
	// ContextKeyNextExecuteTime is the key that refer to the next execute time in workflow context config map.
	ContextKeyNextExecuteTime = "next_execute_time"
)
View Source
const (
	// WorkflowStepTypeSuspend type suspend
	WorkflowStepTypeSuspend = "suspend"
	// WorkflowStepTypeApplyComponent type apply-component
	WorkflowStepTypeApplyComponent = "apply-component"
	// WorkflowStepTypeBuiltinApplyComponent type builtin-apply-component
	WorkflowStepTypeBuiltinApplyComponent = "builtin-apply-component"
	// WorkflowStepTypeStepGroup type step-group
	WorkflowStepTypeStepGroup = "step-group"
)

Variables

This section is empty.

Functions

func IsBuiltinWorkflowStepType added in v1.3.0

func IsBuiltinWorkflowStepType(wfType string) bool

IsBuiltinWorkflowStepType checks if workflow step type is builtin type

Types

type Action

type Action interface {
	Suspend(message string)
	Terminate(message string)
	Wait(message string)
}

Action is that workflow provider can do.

type Engine added in v1.4.0

type Engine interface {
	Run(taskRunners []TaskRunner, dag bool) error
	GetStepStatus(stepName string) common.WorkflowStepStatus
	SetParentRunner(name string)
	GetOperation() *Operation
}

Engine is the engine to run workflow

type GeneratorOptions added in v1.1.1

type GeneratorOptions struct {
	ID             string
	PrePhase       common.WorkflowStepPhase
	StepConvertor  func(step v1beta1.WorkflowStep) (v1beta1.WorkflowStep, error)
	SubTaskRunners []TaskRunner
}

GeneratorOptions is the options for generate task.

type Operation

type Operation struct {
	Suspend            bool
	Terminated         bool
	Waiting            bool
	Skip               bool
	FailedAfterRetries bool
}

Operation is workflow operation object.

type TaskDiscover

type TaskDiscover interface {
	GetTaskGenerator(ctx context.Context, name string) (TaskGenerator, error)
}

TaskDiscover is the interface to obtain the TaskGenerator。

type TaskGenerator

type TaskGenerator func(wfStep v1beta1.WorkflowStep, options *GeneratorOptions) (TaskRunner, error)

TaskGenerator will generate taskRunner.

type TaskPostStopHook added in v1.1.1

type TaskPostStopHook func(ctx wfContext.Context, taskValue *value.Value, step v1beta1.WorkflowStep, phase common.WorkflowStepPhase) error

TaskPostStopHook run after task execution.

type TaskPreStartHook added in v1.1.1

type TaskPreStartHook func(ctx wfContext.Context, paramValue *value.Value, step v1beta1.WorkflowStep) error

TaskPreStartHook run before task execution.

type TaskRunOptions added in v1.1.1

type TaskRunOptions struct {
	Data          *value.Value
	PCtx          process.Context
	PreStartHooks []TaskPreStartHook
	PostStopHooks []TaskPostStopHook
	GetTracer     func(id string, step v1beta1.WorkflowStep) monitorCtx.Context
	RunSteps      func(isDag bool, runners ...TaskRunner) (*common.WorkflowStatus, error)
	Debug         func(step string, v *value.Value) error
	Engine        Engine
	ParentRunner  string
}

TaskRunOptions is the options for task run.

type TaskRunner

type TaskRunner interface {
	Name() string
	Pending(ctx wfContext.Context, stepStatus map[string]common.StepStatus) bool
	Run(ctx wfContext.Context, options *TaskRunOptions) (common.StepStatus, *Operation, error)
	Skip(dependsOnPhase common.WorkflowStepPhase, stepStatus map[string]common.StepStatus) (common.StepStatus, bool)
}

TaskRunner is a task runner.

Jump to

Keyboard shortcuts

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