update caching and server creation

This commit is contained in:
Fran Jurmanović
2025-06-01 19:48:39 +02:00
parent 8a3b11b1ef
commit d57013bb50
26 changed files with 888 additions and 249 deletions

View File

@@ -0,0 +1,38 @@
package model
import "time"
type SessionCount struct {
Name string `json:"name"`
Count int `json:"count"`
}
type DailyActivity struct {
Date time.Time `json:"date"`
SessionsCount int `json:"sessionsCount"`
}
type PlayerCountPoint struct {
Timestamp time.Time `json:"timestamp"`
Count int `json:"count"`
}
type StateHistoryStats struct {
AveragePlayers float64 `json:"averagePlayers"`
PeakPlayers int `json:"peakPlayers"`
TotalSessions int `json:"totalSessions"`
TotalPlaytime int `json:"totalPlaytime"` // in minutes
PlayerCountOverTime []PlayerCountPoint `json:"playerCountOverTime"`
SessionTypes []SessionCount `json:"sessionTypes"`
DailyActivity []DailyActivity `json:"dailyActivity"`
RecentSessions []RecentSession `json:"recentSessions"`
}
type RecentSession struct {
ID uint `json:"id"`
Date time.Time `json:"date"`
Type string `json:"type"`
Track string `json:"track"`
Duration int `json:"duration"`
Players int `json:"players"`
}