workflow

package module
v0.0.0-...-bfe4c39 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

README

go-workflow

deprecated

Simple control flow library to setup a series of steps to execute.

Example

w := workflow.New()
w.OnFailure = workflow.InteractiveFailure
steps := []*workflow.Step{
	&workflow.Step{
		Label: "one",
		Run:   stepOne,
	},
	&workflow.Step{
		Label: "two",
		Run:   stepTwo,
		},
	}
}
w.AddSteps(steps)
w.Run()

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InputFile io.Reader = os.Stdin
)

Functions

func InteractiveFailure

func InteractiveFailure(err error, step *Step, context Context) error

Types

type Context

type Context interface{}

type FailureFunc

type FailureFunc func(err error, step *Step, context Context) error

func RetryFailure

func RetryFailure(tries int) FailureFunc

type Step

type Step struct {
	Label     string
	Run       StepFunc
	DependsOn []*Step
}

type StepFunc

type StepFunc func(context Context) error

type Workflow

type Workflow struct {
	Start     *Step
	OnFailure FailureFunc
	Context   Context
	// contains filtered or unexported fields
}

func New

func New() *Workflow

func (*Workflow) Run

func (w *Workflow) Run() error

Jump to

Keyboard shortcuts

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