diff options
author | Keuin <[email protected]> | 2023-07-29 12:10:43 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-07-29 20:47:11 +0800 |
commit | e72342b0027752dc93e57ebec99c4eb9a8aa8efe (patch) | |
tree | 9c5ebe527e54a0d2f6430c37762137e1ca59f5a3 /recording/task.go | |
parent | 7a8f91d2297d5f43378a5f181ae34aaef6a82367 (diff) |
wip
Diffstat (limited to 'recording/task.go')
-rw-r--r-- | recording/task.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/recording/task.go b/recording/task.go index 5c1f5ee..26f3638 100644 --- a/recording/task.go +++ b/recording/task.go @@ -22,6 +22,17 @@ const ( StStopped ) +var taskStatusStrings = map[TaskStatus]string{ + StNotStarted: "ready", + StRunning: "running", + StRestarting: "restarting", + StStopped: "stopped", +} + +func (s TaskStatus) String() string { + return taskStatusStrings[s] +} + var ( ErrTaskIsAlreadyStarted = fmt.Errorf("task is already started") ErrTaskIsStopped = fmt.Errorf("restarting a stopped task is not allowed") |