execution

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: Apache-2.0 Imports: 6 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 {
	ID                string
	Service           *service.Service
	Task              string
	Tags              []string
	CreatedAt         time.Time
	ExecutedAt        time.Time
	ExecutionDuration time.Duration
	Inputs            map[string]interface{}
	Output            string
	OutputData        map[string]interface{}
}

Execution stores all informations about executions.

func Create

func Create(serviceForExecution *service.Service, task string, inputs map[string]interface{}, tags []string) (*Execution, error)

Create creates an execution with a unique ID and puts it in the pending list.

func InProgress

func InProgress(ID string) (execution *Execution)

InProgress returns the matching in progress execution if exists

func (*Execution) Complete

func (execution *Execution) Complete(output string, data map[string]interface{}) error

Complete marks an execution as complete and puts into the list of processed tasks.

func (*Execution) Execute

func (execution *Execution) Execute() error

Execute moves an execution from pending to in progress queue and publishes the job for processing.

type NotInQueueError added in v0.2.0

type NotInQueueError struct {
	ID    string
	Queue string
}

NotInQueueError is an error when trying to access an execution that doesn't exists.

func (*NotInQueueError) Error added in v0.2.0

func (e *NotInQueueError) Error() string

Jump to

Keyboard shortcuts

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