GoTomato/pkg/models/server.go

12 lines
668 B
Go

package models
// Represents the data sent to the client via WebSocket
type ServerMessage struct {
Mode string `json:"mode"` // "Idle", "Work", "ShortBreak", "LongBreak" or "End"
Settings PomodoroConfig `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"` // Pomodoro ongoing
Paused bool `json:"paused"` // Is timer paused
ProtocolVersion string `json:"version"` // Version of the protocol
}