2024-10-20 12:31:52 +00:00
|
|
|
package models
|
|
|
|
|
2024-10-30 10:28:42 +00:00
|
|
|
import "fmt"
|
|
|
|
|
2024-10-30 06:37:14 +00:00
|
|
|
// Represents the configuration of a pomodoro
|
2024-10-26 07:20:29 +00:00
|
|
|
type PomodoroConfig struct {
|
2024-11-18 07:11:39 +00:00
|
|
|
Focus int `json:"focus"` // Length of focus sessions in seconds
|
2024-10-20 18:49:36 +00:00
|
|
|
ShortBreak int `json:"shortBreak"` // Length of short break in seconds
|
2024-10-30 06:37:14 +00:00
|
|
|
LongBreak int `json:"longBreak"` // Length of long break in seconds
|
2024-10-20 18:49:36 +00:00
|
|
|
Sessions int `json:"sessions"` // Number of total sessions
|
2024-10-20 12:42:50 +00:00
|
|
|
}
|
|
|
|
|
2024-10-30 10:28:42 +00:00
|
|
|
// Stringer interface for the PomodocoConfig model
|
|
|
|
func (c PomodoroConfig) String() string {
|
2024-11-18 07:11:39 +00:00
|
|
|
return fmt.Sprintf("{focus: %d, short: %d, long: %d, sessions: %d}", c.Focus, c.ShortBreak, c.LongBreak, c.Sessions)
|
2024-10-30 10:28:42 +00:00
|
|
|
}
|
|
|
|
|
2024-10-30 06:37:14 +00:00
|
|
|
// Represents the server configuration
|
2024-10-26 07:22:21 +00:00
|
|
|
type ServerConfig struct {
|
2024-10-20 18:49:36 +00:00
|
|
|
ListenAddress string `json:"listenAddress"` // Server listen address
|
|
|
|
ListenPort int `json:"listenPort"` // Server listen port
|
2024-10-20 12:31:52 +00:00
|
|
|
}
|