feat: rename Client
model to WebsocketClient
🤖
This commit is contained in:
parent
2d2ea6ff78
commit
ebb58a4489
3 changed files with 5 additions and 5 deletions
|
@ -10,7 +10,7 @@ import (
|
|||
)
|
||||
|
||||
// Clients is a map of connected WebSocket clients, where each client is represented by the Client struct
|
||||
var Clients = make(map[*websocket.Conn]*models.Client)
|
||||
var Clients = make(map[*websocket.Conn]*models.WebsocketClient)
|
||||
var mu sync.Mutex // Mutex to protect access to the Clients map
|
||||
|
||||
// Upgrade HTTP requests to WebSocket connections
|
||||
|
@ -31,7 +31,7 @@ func HandleConnection(w http.ResponseWriter, r *http.Request) {
|
|||
log.Info("Client connected", "host", ws.NetConn().RemoteAddr(), "clients", len(Clients)+1)
|
||||
|
||||
// Register the new client
|
||||
client := models.Client{
|
||||
client := models.WebsocketClient{
|
||||
Conn: ws,
|
||||
}
|
||||
mu.Lock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue