summaryrefslogtreecommitdiff
path: root/recording/task.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-07-29 12:10:43 +0800
committerKeuin <[email protected]>2023-07-29 20:47:11 +0800
commite72342b0027752dc93e57ebec99c4eb9a8aa8efe (patch)
tree9c5ebe527e54a0d2f6430c37762137e1ca59f5a3 /recording/task.go
parent7a8f91d2297d5f43378a5f181ae34aaef6a82367 (diff)
wip
Diffstat (limited to 'recording/task.go')
-rw-r--r--recording/task.go11
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")