impl

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJSONPointer

func GenerateJSONPointer(workflow *model.Workflow, targetNode interface{}) (string, error)

GenerateJSONPointer Function to generate JSON Pointer from a Workflow reference

Types

type CallHTTPTaskRunner

type CallHTTPTaskRunner struct {
	TaskName string
}

func NewCallHttpRunner

func NewCallHttpRunner(taskName string, task *model.CallHTTP) (taskRunner *CallHTTPTaskRunner, err error)

func (*CallHTTPTaskRunner) GetTaskName

func (f *CallHTTPTaskRunner) GetTaskName() string

func (*CallHTTPTaskRunner) Run

func (f *CallHTTPTaskRunner) Run(input interface{}, taskSupport TaskSupport) (interface{}, error)

type DoTaskRunner

type DoTaskRunner struct {
	TaskList *model.TaskList
}

func NewDoTaskRunner

func NewDoTaskRunner(taskList *model.TaskList) (*DoTaskRunner, error)

func (*DoTaskRunner) GetTaskName

func (d *DoTaskRunner) GetTaskName() string

func (*DoTaskRunner) Run

func (d *DoTaskRunner) Run(input interface{}, taskSupport TaskSupport) (output interface{}, err error)

type ForTaskRunner

type ForTaskRunner struct {
	Task     *model.ForTask
	TaskName string
	DoRunner *DoTaskRunner
}

func NewForTaskRunner

func NewForTaskRunner(taskName string, task *model.ForTask) (*ForTaskRunner, error)

func (*ForTaskRunner) GetTaskName

func (f *ForTaskRunner) GetTaskName() string

func (*ForTaskRunner) Run

func (f *ForTaskRunner) Run(input interface{}, taskSupport TaskSupport) (interface{}, error)

type ForkTaskRunner

type ForkTaskRunner struct {
	Task          *model.ForkTask
	TaskName      string
	BranchRunners []TaskRunner
}

func NewForkTaskRunner

func NewForkTaskRunner(taskName string, task *model.ForkTask, workflowDef *model.Workflow) (*ForkTaskRunner, error)

func (ForkTaskRunner) GetTaskName

func (f ForkTaskRunner) GetTaskName() string

func (ForkTaskRunner) Run

func (f ForkTaskRunner) Run(input interface{}, parentSupport TaskSupport) (interface{}, error)

type RaiseTaskRunner

type RaiseTaskRunner struct {
	Task     *model.RaiseTask
	TaskName string
}

func NewRaiseTaskRunner

func NewRaiseTaskRunner(taskName string, task *model.RaiseTask, workflowDef *model.Workflow) (*RaiseTaskRunner, error)

func (*RaiseTaskRunner) GetTaskName

func (r *RaiseTaskRunner) GetTaskName() string

func (*RaiseTaskRunner) Run

func (r *RaiseTaskRunner) Run(input interface{}, taskSupport TaskSupport) (output interface{}, err error)

type SetTaskRunner

type SetTaskRunner struct {
	Task     *model.SetTask
	TaskName string
}

func NewSetTaskRunner

func NewSetTaskRunner(taskName string, task *model.SetTask) (*SetTaskRunner, error)

func (*SetTaskRunner) GetTaskName

func (s *SetTaskRunner) GetTaskName() string

func (*SetTaskRunner) Run

func (s *SetTaskRunner) Run(input interface{}, taskSupport TaskSupport) (output interface{}, err error)

type TaskRunner

type TaskRunner interface {
	Run(input interface{}, taskSupport TaskSupport) (interface{}, error)
	GetTaskName() string
}

func NewTaskRunner

func NewTaskRunner(taskName string, task model.Task, workflowDef *model.Workflow) (TaskRunner, error)

NewTaskRunner creates a TaskRunner instance based on the task type.

type TaskSupport

type TaskSupport interface {
	SetTaskStatus(task string, status ctx.StatusPhase)
	GetWorkflowDef() *model.Workflow
	// SetWorkflowInstanceCtx is the `$context` variable accessible in JQ expressions and set in `export.as`
	SetWorkflowInstanceCtx(value interface{})
	// GetContext gets the sharable Workflow context. Accessible via ctx.GetWorkflowContext.
	GetContext() context.Context
	SetTaskRawInput(value interface{})
	SetTaskRawOutput(value interface{})
	SetTaskDef(task model.Task) error
	SetTaskStartedAt(value time.Time)
	SetTaskName(name string)
	// SetTaskReferenceFromName based on the taskName and the model.Workflow definition, set the JSON Pointer reference to the context
	SetTaskReferenceFromName(taskName string) error
	GetTaskReference() string
	// SetLocalExprVars overrides local variables in expression processing
	SetLocalExprVars(vars map[string]interface{})
	// AddLocalExprVars adds to the local variables in expression processing. Won't override previous entries.
	AddLocalExprVars(vars map[string]interface{})
	// RemoveLocalExprVars removes local variables added in AddLocalExprVars or SetLocalExprVars
	RemoveLocalExprVars(keys ...string)
	// CloneWithContext returns a full clone of this TaskSupport, but using
	// the provided context.Context (so deadlines/cancellations propagate).
	CloneWithContext(ctx context.Context) TaskSupport
}

type WorkflowRunner

type WorkflowRunner interface {
	GetWorkflowDef() *model.Workflow
	Run(input interface{}) (output interface{}, err error)
	GetWorkflowCtx() ctx.WorkflowContext
}

WorkflowRunner is the public API to run Workflows

func NewDefaultRunner

func NewDefaultRunner(workflow *model.Workflow) (WorkflowRunner, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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