radchat/server/client.go
2025-09-04 19:42:02 -05:00

22 lines
467 B
Go

package server
// Client represents a single WebSocket connection and associated user state.
// It includes a send channel for outbound messages and LastPong for liveness.
import (
"sync"
"time"
"github.com/gorilla/websocket"
)
// Client holds the websocket connection and linkage back to the Hub.
type Client struct {
Conn *websocket.Conn
Username string
Id string
Hub *Hub
Mu sync.RWMutex
LastPong time.Time
Send chan []byte
}