GoTomato/pkg/models/broadcast.go
Sebastian Mark 4471c86a0c fix: prevent concurrent write to websocket connection
- refactor client handling and message broadcasting
- replace Client struct
- implement SendMessage method in Client struct for safer message sending
- update client map to use *models.Client instead of bool
- adjust BroadcastMessage and RunPomodoroTimer functions to use new client type

🤖
2024-10-20 11:06:37 +02:00

9 lines
406 B
Go

package models
// BroadcastMessage represents the data sent to the client via WebSocket.
type BroadcastMessage struct {
Mode string `json:"mode"` // "Work", "ShortBreak", or "LongBreak"
Session int `json:"session"` // Current session number
MaxSession int `json:"max_session"` // Total number of sessions
TimeLeft int `json:"time_left"` // Remaining time in seconds
}