diff options
author | Keuin <[email protected]> | 2023-07-29 21:20:12 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-07-29 21:20:12 +0800 |
commit | 110301a975e43739192577166d089e28c22ae266 (patch) | |
tree | e655e00876b0140aa9ad431824765cd1c8371899 /agent.go | |
parent | e72342b0027752dc93e57ebec99c4eb9a8aa8efe (diff) |
Add API server
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(), + } + }) +} |