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:
parent
f1071f33c6
commit
b943c9d6eb
6 changed files with 26 additions and 24 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue