refactor: simplify codebase
This commit is contained in:
+10
-39
@@ -2,18 +2,11 @@ package tui
|
||||
|
||||
import (
|
||||
"parasocial/internal/auth"
|
||||
"parasocial/internal/irc"
|
||||
"parasocial/internal/miner"
|
||||
"parasocial/internal/twitch"
|
||||
)
|
||||
|
||||
// IRCState describes the current IRC join lifecycle for one streamer row.
|
||||
type IRCState string
|
||||
|
||||
const (
|
||||
IRCPending IRCState = "pending"
|
||||
IRCJoined IRCState = "joined"
|
||||
IRCDisconnected IRCState = "disconnected"
|
||||
)
|
||||
|
||||
// AuthUpdate carries one incremental auth log line or completion result into the TUI.
|
||||
type AuthUpdate struct {
|
||||
Line string
|
||||
@@ -24,36 +17,14 @@ type AuthUpdate struct {
|
||||
|
||||
// StreamerUpdate carries one streamer resolution update into the TUI.
|
||||
type StreamerUpdate struct {
|
||||
Viewer *twitch.Viewer
|
||||
Entry *twitch.StreamerEntry
|
||||
IRC *IRCUpdate
|
||||
Miner *MinerUpdate
|
||||
Index int
|
||||
Err error
|
||||
Done bool
|
||||
}
|
||||
|
||||
// IRCUpdate carries one IRC connection state or log line into the TUI.
|
||||
type IRCUpdate struct {
|
||||
Login string
|
||||
State IRCState
|
||||
Line string
|
||||
}
|
||||
|
||||
// MinerUpdate carries one miner log line into the TUI.
|
||||
type MinerUpdate struct {
|
||||
Login string
|
||||
Line string
|
||||
Status *MinerStatus
|
||||
}
|
||||
|
||||
// MinerStatus carries the current active watch state for one streamer.
|
||||
type MinerStatus struct {
|
||||
Watching bool
|
||||
Reason string
|
||||
WatchedMinutes int
|
||||
WatchStreakMinutes int
|
||||
WatchStreak *int
|
||||
Viewer *twitch.Viewer
|
||||
Entry *twitch.StreamerEntry
|
||||
IRC *irc.Event
|
||||
MinerLog *miner.LogEntry
|
||||
MinerStatus *miner.StatusEntry
|
||||
Index int
|
||||
Err error
|
||||
Done bool
|
||||
}
|
||||
|
||||
type authStartedMsg struct {
|
||||
|
||||
Reference in New Issue
Block a user