diff options
Diffstat (limited to 'agent.go')
-rw-r--r-- | agent.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/agent.go b/agent.go new file mode 100644 index 0000000..9f021f5 --- /dev/null +++ b/agent.go @@ -0,0 +1,23 @@ +package main + +import ( + "github.com/keuin/slbr/api/agent" + "github.com/keuin/slbr/recording" + "github.com/samber/lo" +) + +type agentImpl struct { + tasks *[]*recording.RunningTask +} + +func (a *agentImpl) GetTasks() []agent.TaskInfo { + return lo.Map(*a.tasks, func(t *recording.RunningTask, _ int) agent.TaskInfo { + return agent.TaskInfo{ + LiveRoom: agent.LiveRoomInfo{ + ID: t.RoomId, + Title: t.GetRoomTitle(), + }, + Status: t.GetStatus().String(), + } + }) +} |