David K. Bainbridge | f0da873 | 2016-06-01 16:15:37 -0700 | [diff] [blame] | 1 | package main |
2 | |||||
3 | type TaskStatus uint8 | ||||
4 | |||||
5 | const ( | ||||
6 | Pending TaskStatus = iota | ||||
7 | Running | ||||
8 | Complete | ||||
9 | Failed | ||||
10 | ) | ||||
11 | |||||
12 | func (s TaskStatus) String() string { | ||||
13 | switch s { | ||||
14 | case Pending: | ||||
15 | return "PENDING" | ||||
16 | case Running: | ||||
17 | return "RUNNING" | ||||
18 | case Complete: | ||||
19 | return "COMPLETE" | ||||
20 | case Failed: | ||||
21 | return "FAILED" | ||||
22 | } | ||||
23 | return "INVALID TASK STATUS" | ||||
24 | } |