feat: refactor client methods

- change `ProcessServerMessages` to use receiver instead of parameter
- update `Disconnect` method to use receiver for better encapsulation
- move `Client` definition to `connect.go`

🤖
This commit is contained in:
Sebastian Mark 2024-10-30 09:51:59 +01:00
parent 480f1c0cdd
commit 6187122b81
4 changed files with 10 additions and 9 deletions

View file

@ -5,12 +5,9 @@ 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"
)
type Client ChronoTomato.GoTomatoClient // New websocket client
func (c Client) sendClientCommand(msg GoTomato.ClientCommand) {
messageBytes, err := json.Marshal(msg)
if err != nil {