types

package
v0.0.0-...-132a670 Latest Latest
Warning

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

Go to latest
Published: May 2, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity interface {
	Task

	Next() Node
}

func NewSimpleActivity

func NewSimpleActivity(name string, executor func() error, nextNode Node) Activity

func NewSimplePrintMessageActivity

func NewSimplePrintMessageActivity(logger logging.Logger, name, msg string, nextNode Node) Activity

type Condition

type Condition interface {
	Node

	ConditionAnswerProvider() ConditionAnswerProvider

	WhenTrue() Node
	WhenFalse() Node
}

type ConditionAnswerProvider

type ConditionAnswerProvider interface {
	ConditionAnswer() bool
}

type EventHandler

type EventHandler interface {
	Info(msg string)
	Error(msg string)
}

type Node

type Node interface {
	Name() string

	Accept(visitor NodeVisitor)
}

type NodeError

type NodeError struct {
	Node  Node
	Error error
}

type NodeSlice

type NodeSlice []Node

func (NodeSlice) ContainsNode

func (n NodeSlice) ContainsNode(node Node) bool

type NodeVisitor

type NodeVisitor interface {
	VisitTask(node Task)
	VisitActivity(node Activity)
	VisitCondition(node Condition)
	VisitSwitch(node Switch)
	VisitParallelFork(node ParallelFork)
}

type ParallelFork

type ParallelFork interface {
	Node

	Legs() []Task
	Next() Node
}

type Switch

type Switch interface {
	Node

	Cases() []*SwitchCase
}

func NewSimpleSwitch

func NewSimpleSwitch(name string, cases []*SwitchCase) Switch

type SwitchCase

type SwitchCase struct {
	Predicate func() bool
	Name      string
	Node      Node
}

type Task

type Task interface {
	Node

	Execute() error
}

type Workflow

type Workflow struct {
	// contains filtered or unexported fields
}

func (*Workflow) DefaultDrawer

func (w *Workflow) DefaultDrawer() *flowdiagrams.Drawer

func (*Workflow) Execute

func (w *Workflow) Execute() error

func (*Workflow) ExecutedPathDrawer

func (w *Workflow) ExecutedPathDrawer() *flowdiagrams.Drawer

func (*Workflow) Validate

func (w *Workflow) Validate() error

type WorkflowBuilder

type WorkflowBuilder struct {
	// contains filtered or unexported fields
}

func NewWorkflowBuilder

func NewWorkflowBuilder(initialNode Node) *WorkflowBuilder

func (*WorkflowBuilder) Build

func (w *WorkflowBuilder) Build() (*Workflow, error)

func (*WorkflowBuilder) SetEventHandler

func (w *WorkflowBuilder) SetEventHandler(eventHandler EventHandler) *WorkflowBuilder

Jump to

Keyboard shortcuts

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