summaryrefslogtreecommitdiff
path: root/recording
diff options
context:
space:
mode:
Diffstat (limited to 'recording')
-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")