feat: refactor client handling and introduce websocket client type
- add new websocket.Client type
- change Connect and Disconnect functions to use the new Client type
- implement methods for sending commands and updating settings on Client
- update keyhandler to use websocket.Client instead of ChronoTomato.Client
- modify UpdateLoop to accept websocket.Client
- refactor ProcessServerMessages to accept the new Client type
🤖
This commit is contained in:
parent
b943c9d6eb
commit
0ca90b50a5
6 changed files with 25 additions and 18 deletions
|
@ -6,13 +6,12 @@ import (
|
|||
"github.com/charmbracelet/log"
|
||||
"github.com/gorilla/websocket"
|
||||
|
||||
ChronoTomato "git.smsvc.net/pomodoro/ChronoTomato/pkg/models"
|
||||
GoTomato "git.smsvc.net/pomodoro/GoTomato/pkg/models"
|
||||
)
|
||||
|
||||
var Done = make(chan struct{})
|
||||
|
||||
func ProcessServerMessages(client ChronoTomato.Client, channel chan<- GoTomato.ServerMessage) {
|
||||
func ProcessServerMessages(client Client, channel chan<- GoTomato.ServerMessage) {
|
||||
var serverMessage GoTomato.ServerMessage
|
||||
|
||||
defer close(Done)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue