2024-10-20 11:06:37 +02:00
|
|
|
package models
|
|
|
|
|
|
|
|
import (
|
2024-11-20 14:07:00 +01:00
|
|
|
"time"
|
2024-11-04 20:33:25 +01:00
|
|
|
|
2024-11-20 14:07:00 +01:00
|
|
|
"github.com/gorilla/websocket"
|
2024-10-20 11:06:37 +02:00
|
|
|
)
|
|
|
|
|
2024-10-30 07:37:14 +01:00
|
|
|
// Represents a command from the client (start/stop)
|
2024-10-20 11:06:37 +02:00
|
|
|
type ClientCommand struct {
|
2024-10-30 07:37:14 +01:00
|
|
|
Command string `json:"command"` // Command send to the server
|
|
|
|
Password string `json:"password"` // Pomodoro control password
|
|
|
|
Settings PomodoroConfig `json:"settings"` // Pomodoro config
|
2024-10-20 11:06:37 +02:00
|
|
|
}
|
|
|
|
|
2024-10-30 07:37:14 +01:00
|
|
|
// Represents a single client
|
2024-10-30 09:57:09 +01:00
|
|
|
type WebsocketClient struct {
|
2024-11-20 14:07:00 +01:00
|
|
|
Conn *websocket.Conn
|
|
|
|
LastPong time.Time
|
|
|
|
RealIP string
|
2024-10-20 11:06:37 +02:00
|
|
|
}
|