workflow

package
v0.0.0-...-d090841 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StepOK      StepStatus = 0
	StepFail               = 1
	StepRunning            = 2
	StepPending            = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Step

type Step struct {
	StepDefinition
	Status        StepStatus
	NextSteps     []*Step
	PreviousSteps []*Step
}

func (*Step) AddRequirement

func (step *Step) AddRequirement(parent *Step)

func (*Step) Execute

func (step *Step) Execute(channel chan *Step, ctx ctx.WorkflowContext, previousStepsOutput map[string]map[string]string)

func (*Step) RequirementsFulfilled

func (step *Step) RequirementsFulfilled() (bool, error)

RequirementsFulfilled Check if all requirements steps have been completed by checking there status.

type StepDefinition

type StepDefinition interface {
	Init(ctx ctx.WorkflowContext, previousStepsOutput map[string]map[string]string) error
	Run(ctx ctx.WorkflowContext) error
	Clean()
	GetLabel() string
	GetName() string
	GetDescription() string
	GetDependencies() []string
	GetOutput() map[string]string
}

type StepStatus

type StepStatus uint16

func (StepStatus) GetName

func (s StepStatus) GetName() string

type Workflow

type Workflow struct {
	Steps []*Step
	// contains filtered or unexported fields
}

func NewWorkflow

func NewWorkflow(firstStep *Step, steps []*Step) *Workflow

func (*Workflow) Print

func (wf *Workflow) Print()

func (*Workflow) Run

func (wf *Workflow) Run(ctx ctx.WorkflowContext) (map[string]map[string]string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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