Brian O'Connor | 6a37ea9 | 2017-08-03 22:45:59 -0700 | [diff] [blame] | 1 | // Copyright 2016 Open Networking Foundation |
David K. Bainbridge | df9df63 | 2016-07-07 18:47:46 -0700 | [diff] [blame] | 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
David K. Bainbridge | f0da873 | 2016-06-01 16:15:37 -0700 | [diff] [blame] | 14 | package main |
| 15 | |
| 16 | type TaskStatus uint8 |
| 17 | |
| 18 | const ( |
| 19 | Pending TaskStatus = iota |
| 20 | Running |
| 21 | Complete |
| 22 | Failed |
| 23 | ) |
| 24 | |
| 25 | func (s TaskStatus) String() string { |
| 26 | switch s { |
| 27 | case Pending: |
| 28 | return "PENDING" |
| 29 | case Running: |
| 30 | return "RUNNING" |
| 31 | case Complete: |
| 32 | return "COMPLETE" |
| 33 | case Failed: |
| 34 | return "FAILED" |
| 35 | } |
| 36 | return "INVALID TASK STATUS" |
| 37 | } |