feat: refactor connection handling to use models.Client

- introduce `Client` model
- modify all websocket operations to use the new `Client` model
- update function signatures to accept `models.Client` instead of `*websocket.Conn`
- ensure consistent usage of `client` across all related functions

🤖
This commit is contained in:
Sebastian Mark 2024-10-30 08:28:22 +01:00
parent f1071f33c6
commit b943c9d6eb
6 changed files with 26 additions and 24 deletions

View file

@ -35,11 +35,11 @@ func Start() {
config = helper.ParseConfig(*configfile)
}
conn := websocket.Connect(config.URL)
client := websocket.Connect(config.URL)
channel := make(chan GoTomato.ServerMessage)
go websocket.ProcessServerMessages(conn, channel)
frontend.UpdateLoop(conn, config, channel)
go websocket.ProcessServerMessages(client, channel)
frontend.UpdateLoop(client, config, channel)
websocket.Disconnect(conn)
websocket.Disconnect(client)
}