Documentation
¶
Index ¶
- Variables
- type Execution
- func (execution *Execution) Complete(outputs *types.Struct) error
- func (*Execution) Descriptor() ([]byte, []int)
- func (this *Execution) Equal(that interface{}) bool
- func (execution *Execution) Execute() error
- func (execution *Execution) Failed(err error) error
- func (*Execution) ProtoMessage()
- func (m *Execution) Reset()
- func (m *Execution) String() string
- func (m *Execution) XXX_DiscardUnknown()
- func (m *Execution) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Execution) XXX_Merge(src proto.Message)
- func (m *Execution) XXX_Size() int
- func (m *Execution) XXX_Unmarshal(b []byte) error
- type Status
- type StatusError
Constants ¶
This section is empty.
Variables ¶
var Status_name = map[int32]string{
0: "Unknown",
1: "Created",
2: "InProgress",
3: "Completed",
4: "Failed",
}
var Status_value = map[string]int32{
"Unknown": 0,
"Created": 1,
"InProgress": 2,
"Completed": 3,
"Failed": 4,
}
Functions ¶
This section is empty.
Types ¶
type Execution ¶
type Execution struct {
// Hash is a unique hash to identify execution.
Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-"`
// parentHash is the unique hash of parent execution.
// if execution is triggered by another one,
// dependency execution considered as the parent.
ParentHash github_com_mesg_foundation_engine_hash.Hash `` /* 132-byte string literal not displayed */
// eventHash is unique event hash.
EventHash github_com_mesg_foundation_engine_hash.Hash `` /* 130-byte string literal not displayed */
// Status is the current status of execution.
Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=mesg.types.Status" json:"status,omitempty" hash:"-"`
// instanceHash is hash of the instance that can proceed an execution
InstanceHash github_com_mesg_foundation_engine_hash.Hash `` /* 136-byte string literal not displayed */
// taskKey is the key of the task of this execution.
TaskKey string `protobuf:"bytes,6,opt,name=taskKey,proto3" json:"taskKey,omitempty" hash:"name:6"`
// inputs data of the execution.
Inputs *types.Struct `protobuf:"bytes,7,opt,name=inputs,proto3" json:"inputs,omitempty" hash:"name:7"`
// outputs are the returned data of successful execution.
Outputs *types.Struct `protobuf:"bytes,8,opt,name=outputs,proto3" json:"outputs,omitempty" hash:"-"`
// error message of a failed execution.
Error string `protobuf:"bytes,9,opt,name=error,proto3" json:"error,omitempty" hash:"-"`
// tags are optionally associated with execution by the user.
Tags []string `protobuf:"bytes,10,rep,name=tags,proto3" json:"tags,omitempty" hash:"name:10" validate:"dive,printascii"`
// processHash is the unique hash of the process associated to this execution.
ProcessHash github_com_mesg_foundation_engine_hash.Hash `` /* 136-byte string literal not displayed */
// node key of the process.
NodeKey string `protobuf:"bytes,12,opt,name=nodeKey,proto3" json:"nodeKey,omitempty" hash:"name:12"`
// runner that should execute this execution.
ExecutorHash github_com_mesg_foundation_engine_hash.Hash `` /* 138-byte string literal not displayed */
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Execution represents a single execution run in engine.
func New ¶ added in v0.4.0
func New(processHash, instanceHash, parentHash, eventHash hash.Hash, nodeKey, taskKey string, inputs *types.Struct, tags []string, executorHash hash.Hash) *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.
func (*Execution) Descriptor ¶ added in v0.14.0
func (*Execution) Execute ¶
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
Failed changes execution status to failed and puts error information to execution. It returns an error if the status is different then InProgress.
func (*Execution) ProtoMessage ¶ added in v0.14.0
func (*Execution) ProtoMessage()
func (*Execution) XXX_DiscardUnknown ¶ added in v0.14.0
func (m *Execution) XXX_DiscardUnknown()
func (*Execution) XXX_Marshal ¶ added in v0.14.0
func (*Execution) XXX_Unmarshal ¶ added in v0.14.0
type Status ¶ added in v0.4.0
type Status int32
Status represents the status of a single execution. Note that a valid execution must have only one status flag at time.
const ( // Unknown status represents any status unknown to execution. Status_Unknown Status = 0 // Created is an initial status after execution creation. Status_Created Status = 1 // InProgress informs that processing of execution has been started. Status_InProgress Status = 2 // Completed is a success status after execution was processed. Status_Completed Status = 3 // Failed is an error status after execution was processed. Status_Failed Status = 4 )
func (Status) EnumDescriptor ¶ added in v0.14.0
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.