Sebastian Mark
4471c86a0c
- 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
🤖
9 lines
406 B
Go
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
|
|
}
|