GoTomato/pkg/models/server.go
Sebastian Mark 2aa8163189 feat(readme): add protocol version to server messages
- define GoTomatoVersion constant for versioning
- add version field to all server message examples
- add `-version` cli parameter

🤖
2024-10-22 17:18:05 +02:00

12 lines
744 B
Go

package models
// ServerMessage represents the data sent to the client via WebSocket.
type ServerMessage struct {
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
GoTomatoVersion string `json:"version"` // Version of the server
}