workflow

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct {
	EndTime      time.Time
	ErrorMessage string
	Last         string
	StartTime    time.Time
	State        string
	UUID         string
	Variables    map[string]interface{}
	Workflow     Workflow
}

Runner is a stateful representation of a Running Workflow

func NewRunner

func NewRunner(uuid string, wf Workflow) (wfr Runner)

NewRunner initialises and Return a Runner

func ParseRunner

func ParseRunner(data string) (wfr Runner, err error)

ParseRunner returns a parsed Runner from a string

func (*Runner) Current

func (wfr *Runner) Current() (i int, s Step)

Current returns the current step. It is used, mainly, after a step has returned to add extra data

func (*Runner) End

func (wfr *Runner) End()

End will set state to "ended" and end the workflow runner

func (*Runner) Fail

func (wfr *Runner) Fail(msg string)

Fail will set state to "failed" and end the workflow runner

func (*Runner) Next

func (wfr *Runner) Next() (s Step, done bool)

Next returns the next Step of a Runner

func (*Runner) Start

func (wfr *Runner) Start()

Start puts a Running Workflow into a started state

type Step

type Step struct {
	Context      map[string]string
	Duration     string
	End          string
	ErrorMessage string
	Failed       bool
	Name         string
	Register     string
	Start        string
	Type         string
	UUID         string
}

Step is a state container containing data per step

func (*Step) Compile

func (s *Step) Compile(v map[string]interface{}) (err error)

Compile with compile, in place, `Step.Context` entry templates with state data from a WorkflowRunner

func (*Step) JSON

func (s *Step) JSON() (j []byte, err error)

JSON representation of a `Step`

func (*Step) SetStatus

func (s *Step) SetStatus(m map[string]interface{})

SetStatus receives data from job nodes and updates compiled Step data within a Workflow Runner for added metadata visibility

type Workflow

type Workflow struct {
	Name      string
	Steps     []Step
	Variables map[string]string
}

Workflow ... Raw workflow configuration container, reflects config in storage and without a state machine

func ParseWorkflow

func ParseWorkflow(data string) (w Workflow, err error)

ParseWorkflow ... Return a Workflow from a textual representation from storage

Jump to

Keyboard shortcuts

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