task_api

package
v0.0.0-...-6217932 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Handle(arg string, log io.Writer) error
}

type Job

type Job struct {
	Id          string
	PlanName    string
	Arg         string
	State       string
	Final       bool
	Error       bool
	StartedAt   int64
	CompletedAt int64
	Logs        []JobLogEntry
}

A Job holds the runtime state of a specific job.

func NewJob

func NewJob(plan *Plan, arg string) *Job

NewJob returns a new job associated with a specific Plan.

func (*Job) Log

func (j *Job) Log(msg string)

type JobLogEntry

type JobLogEntry struct {
	Stamp int64
	Msg   string
}

type Plan

type Plan struct {
	Name         string
	InitialState string
	M            map[string]StateMachineOutput
}

A Plan is a declarative definition of a finite state machine, expressed in terms of the possible state transitions. There is only one final state and it's represented by the empty string.

func NewPlan

func NewPlan(name string, initialState string, planMap map[string][]string) *Plan

NewPlan creates a new task plan.

type StateMachineOutput

type StateMachineOutput struct {
	Ok  string
	Err string
}

Jump to

Keyboard shortcuts

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