-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstat.go
More file actions
29 lines (24 loc) · 824 Bytes
/
stat.go
File metadata and controls
29 lines (24 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package task
// TaskState represents the possible states of a task
type TaskState uint32
const (
StateUnknown TaskState = iota
StateRunning
StateCompleted
StateFailed
)
// TaskStat contains summary information about the current task state.
type TaskStat struct {
ID string `json:"id"`
ShortID string `json:"short_id"`
State TaskState `json:"state"`
StateDesc string `json:"state_desc"`
Interrupted bool `json:"interrupted"`
Progress int `json:"progress"`
// Details contains arbitrary additional stat information
// generated by the task code during execution.
Details interface{} `json:"details"`
// Metadata contains optional user-defined info extracted from the context.
// If not specified, the value will be nil.
Metadata interface{} `json:"metadata"`
}