GoTomato/pkg/models/server.go
Sebastian Mark 9615d4d449 feat: implement permanent broadcast message functionality
- add SendPermanentBroadCastMessage to continuously send updates
- refactor BroadcastMessage to use a shared Message struct
- update pomodoro logic to modify broadcast.Message directly
- adjust client command handling to use broadcast.Clients map
- enhance ServerMessage struct with "Ongoing" and "Paused" fields

🤖
2024-10-21 13:07:19 +02:00

11 lines
549 B
Go

package models
// ServerMessage represents the data sent to the client via WebSocket.
type ServerMessage struct {
Mode string `json:"mode"` // "Work", "ShortBreak", or "LongBreak"
Session int `json:"session"` // Current session number
TotalSession int `json:"total_sessions"` // Total number of sessions
TimeLeft int `json:"time_left"` // Remaining time in seconds
Ongoing bool `json:"ongoing"` // Ongoing pomodoro
Paused bool `json:"paused"` // Is timer paused
}