Documentation ¶
Index ¶
- Constants
- type Task
- func (t *Task) IsWorkerLost(defaultTimeoutSeconds int) bool
- func (t *Task) RecordFailure(reason TaskResultReason, payload *string, message *string, ...) (bool, error)
- func (t *Task) SetProcessing() error
- func (t *Task) SetReceived(workerName, workerUID string) error
- func (t *Task) SetSalvagedByOn(by uuid.UUID, on time.Time) bool
- func (t *Task) SetSuccess(payload *string, message *string, historyLengthLimit int) error
- type TaskPhase
- type TaskRecord
- type TaskResult
- type TaskResultReason
- type TaskResultType
- type TaskSpec
- type TaskStatus
Constants ¶
View Source
const ( TaskPhasePending TaskPhase = "Pending" TaskPhaseReceived TaskPhase = "Received" TaskPhaseProcessing TaskPhase = "Processing" TaskPhaseSucceeded TaskPhase = "Succeeded" TaskPhaseFailed TaskPhase = "Failed" TaskResultSuccess TaskResultType = "Success" TaskResultFailure TaskResultType = "Failure" TaskResultReasonSucceded TaskResultReason = "Succeeded" TaskResultReasonSignaled TaskResultReason = "Signaled" TaskResultReasonTimeout TaskResultReason = "Timeout" TaskResultReasonFailed TaskResultReason = "Failed" TaskResultReasonInternalError TaskResultReason = "InternalError" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct { // TODO change the type to uuid.UUID UID string `json:"uid" yaml:"uid"` ParentUID *string `json:"parentUID,omitempty" yaml:"parentUID,omitempty"` Spec TaskSpec `json:"spec" yaml:"spec"` Status TaskStatus `json:"status" yaml:"status"` }
func (*Task) IsWorkerLost ¶
func (*Task) RecordFailure ¶
func (*Task) SetProcessing ¶
func (*Task) SetReceived ¶
type TaskRecord ¶
type TaskRecord struct { WorkerUID string `json:"workerUID" yaml:"workerUID"` WorkerName string `json:"workerName" yaml:"workerName"` ProcessUID string `json:"processUID" yaml:"processUID"` ReceivedAt time.Time `json:"receivedAt" yaml:"receivedAt"` StartedAt *time.Time `json:"startedAt,omitempty" yaml:"startedAt,omitempty"` FinishedAt *time.Time `json:"finishedAt,omitempty" yaml:"finishedAt,omitempty"` Result *TaskResult `json:"result,omitempty" yaml:"result,omitempty"` SalvagedBy *uuid.UUID `json:"salvagedBy,omitempty" yaml:"salvagedBy,omitempty"` SalvagedAt *time.Time `json:"salvagedAt,omitempty" yaml:"salvagedAt,omitempty"` }
type TaskResult ¶
type TaskResult struct { Type TaskResultType `json:"type" yaml:"type"` Reason TaskResultReason `json:"reason" yaml:"reason"` Message *string `json:"message,omitempty" yaml:"message,omitempty"` Payload *string `json:"payload,omitempty" yaml:"payload,omitempty"` }
type TaskResultReason ¶
type TaskResultReason string
type TaskResultType ¶
type TaskResultType string
type TaskSpec ¶
type TaskStatus ¶
type TaskStatus struct { Phase TaskPhase `json:"phase" yaml:"phase"` CreatedAt time.Time `json:"createdAt" yaml:"createdAt"` CurrentRecord *TaskRecord `json:"currentWork,omitempty" yaml:"currentWork,omitempty"` FailureCount int `json:"failureCount" yaml:"failureCount"` SalvageCount int `json:"salvageCount" yaml:"salvageCount"` History []TaskRecord `json:"history,omitempty" yaml:"history,omitempty"` }
Click to show internal directories.
Click to hide internal directories.