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:
parent
480f1c0cdd
commit
6187122b81
4 changed files with 10 additions and 9 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue