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-10-20 18:49:36 +00:00
|
|
|
Work int `json:"work"` // Length of work sessions in seconds
|
|
|
|
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 {
|
|
|
|
return fmt.Sprintf("{work: %d, short: %d, long: %d, sessions: %d}", c.Work, c.ShortBreak, c.LongBreak, c.Sessions)
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|