From e72342b0027752dc93e57ebec99c4eb9a8aa8efe Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 29 Jul 2023 12:10:43 +0800 Subject: wip --- recording/task.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'recording') 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") -- cgit v1.2.3