Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Execution ¶
type Execution struct { Hash []byte `hash:"-"` ParentHash []byte `hash:"name:parentHash"` EventID string `hash:"name:eventID"` Status Status `hash:"-"` ServiceHash string `hash:"name:serviceHash"` TaskKey string `hash:"name:taskKey"` Tags []string `hash:"name:tags"` Inputs map[string]interface{} `hash:"name:inputs"` Outputs map[string]interface{} `hash:"-"` Error string `hash:"-"` }
Execution stores all informations about executions.
func New ¶ added in v0.4.0
func New(service string, parentHash []byte, eventID, 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 ¶
Complete changes execution status to completed. It verifies the output. It returns an error if the status is different then InProgress or verification fails.
type Status ¶ added in v0.4.0
type Status int
Status stores the state of an execution
Status for an execution Created => The execution is created but not yet processed InProgress => The execution is being processed Completed => The execution is completed
type StatusError ¶ added in v0.4.0
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.