SessionStateString returns the humane/capitalised form of the given session state.
(state string)
| 26 | |
| 27 | // SessionStateString returns the humane/capitalised form of the given session state. |
| 28 | func SessionStateString(state string) string { |
| 29 | switch state { |
| 30 | case "queued": |
| 31 | return "Queued" |
| 32 | case "in_progress": |
| 33 | return "In progress" |
| 34 | case "completed": |
| 35 | return "Ready for review" |
| 36 | case "failed": |
| 37 | return "Failed" |
| 38 | case "idle": |
| 39 | return "Idle" |
| 40 | case "waiting_for_user": |
| 41 | return "Waiting for user" |
| 42 | case "timed_out": |
| 43 | return "Timed out" |
| 44 | case "cancelled": |
| 45 | return "Cancelled" |
| 46 | default: |
| 47 | return state |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | type ColorFunc func(string) string |
| 52 |
nothing calls this directly
no outgoing calls
no test coverage detected