break: enhance server message structure and settings

- add explicit server messages for start and end
- include pomodoro setttings in server messages
- update README

🤖
This commit is contained in:
Sebastian Mark 2024-10-22 07:46:46 +02:00
parent b60df1c025
commit a0dba673a2
5 changed files with 35 additions and 28 deletions

View file

@ -2,10 +2,10 @@ 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
Mode string `json:"mode"` // "Idle", "Work", "ShortBreak", "LongBreak" or "End"
PomodoroSettings GoTomatoPomodoroConfig `json:"settings"` // The currrent pomodoro settings
Session int `json:"session"` // Current session number
TimeLeft int `json:"time_left"` // Remaining time in seconds
Ongoing bool `json:"ongoing"` // Ongoing pomodoro
Paused bool `json:"paused"` // Is timer paused
}