execution

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Execution

type Execution struct {
	Hash         hash.Hash              `hash:"-"`
	WorkflowHash hash.Hash              `hash:"name:workflowHash"`
	ParentHash   hash.Hash              `hash:"name:parentHash"`
	EventHash    hash.Hash              `hash:"name:eventHash"`
	Status       Status                 `hash:"-"`
	InstanceHash hash.Hash              `hash:"name:instanceHash"`
	TaskKey      string                 `hash:"name:taskKey"`
	StepID       string                 `hash:"name:stepID"`
	Tags         []string               `hash:"name:tags"`
	Inputs       map[string]interface{} `hash:"name:inputs"`
	Outputs      map[string]interface{} `hash:"-"`
	Error        string                 `hash:"-"`
}

Execution stores all information about executions.

func New added in v0.4.0

func New(workflowHash, instanceHash, parentHash, eventHash hash.Hash, stepID string, taskKey string, inputs map[string]interface{}, tags []string) *Execution

New returns a new execution. It returns an error if inputs are invalid.

func (*Execution) Complete

func (execution *Execution) Complete(outputs map[string]interface{}) error

Complete changes execution status to completed. It verifies the output. It returns an error if the status is different then InProgress or verification fails.

func (*Execution) Execute

func (execution *Execution) Execute() error

Execute changes executions status to in progres and update its execute time. It returns an error if the status is different then Created.

func (*Execution) Failed added in v0.11.0

func (execution *Execution) Failed(err error) error

Failed changes execution status to failed and puts error information to execution. It returns an error if the status is different then InProgress.

type Status added in v0.4.0

type Status int

Status stores the state of an execution

const (
	Created Status = iota + 1
	InProgress
	Completed
	Failed
)

Status for an execution Created => The execution is created but not yet processed InProgress => The execution is being processed Completed => The execution is completed

func (Status) String added in v0.11.0

func (s Status) String() (r string)

type StatusError added in v0.4.0

type StatusError struct {
	ExpectedStatus Status
	ActualStatus   Status
}

StatusError is an error when the processing is done on en execution with the wrong status

func (StatusError) Error added in v0.4.0

func (e StatusError) Error() string

Error returns the string representation of error.

Jump to

Keyboard shortcuts

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