server

package
v0.0.0-...-aa516e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: GPL-3.0 Imports: 59 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLoggedIn

func IsLoggedIn(c *gin.Context) bool

func NewRouter

func NewRouter(server *Server) *gin.Engine

func RateLimitMiddleware

func RateLimitMiddleware(r rate.Limit, burst int) gin.HandlerFunc

RateLimitMiddleware returns a Gin middleware that enforces per-IP rate limiting. r is the allowed requests per second and burst is the maximum burst size.

Types

type ActionCount

type ActionCount struct {
	Action string `json:"action"`
	Count  int64  `json:"count"`
}

ActionCount represents count of actions by type

type ActiveBan

type ActiveBan struct {
	BanID      string     `json:"ban_id"`
	ServerID   string     `json:"server_id"`
	ServerName string     `json:"server_name"`
	Reason     string     `json:"reason"`
	Permanent  bool       `json:"permanent"`
	ExpiresAt  *time.Time `json:"expires_at,omitempty"`
	CreatedAt  time.Time  `json:"created_at"`
	AdminName  string     `json:"admin_name"`
}

ActiveBan represents a currently active ban on the player

type AltAccountGroup

type AltAccountGroup struct {
	GroupID       string             `json:"group_id"`
	Players       []AltAccountPlayer `json:"players"`
	SharedIPCount int                `json:"shared_ip_count"`
	LastActivity  *time.Time         `json:"last_activity"`
}

AltAccountGroup represents a group of players sharing IPs (potential alts)

type AltAccountPlayer

type AltAccountPlayer struct {
	SteamID        string     `json:"steam_id"`
	EOSID          string     `json:"eos_id"`
	PlayerName     string     `json:"player_name"`
	IsBanned       bool       `json:"is_banned"`
	SharedSessions int64      `json:"shared_sessions"`
	LastSeen       *time.Time `json:"last_seen"`
}

AltAccountPlayer represents a player in an alt account group

type AuditLogEntry

type AuditLogEntry struct {
	ID        uuid.UUID       `json:"id"`
	UserID    *uuid.UUID      `json:"user_id,omitempty"`
	Username  string          `json:"username,omitempty"`
	Action    string          `json:"action"`
	Changes   json.RawMessage `json:"changes,omitempty"`
	Timestamp time.Time       `json:"timestamp"`
}

AuditLogEntry represents an audit log entry

type AuthLoginRequest

type AuthLoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type BulkDeleteRequest

type BulkDeleteRequest struct {
	Paths []string `json:"paths" binding:"required"`
}

BulkDeleteRequest represents a bulk delete operation

type ChatMessage

type ChatMessage struct {
	SentAt     time.Time `json:"sent_at"`
	Message    string    `json:"message"`
	ChatType   string    `json:"chat_type"`
	ServerID   string    `json:"server_id"`
	ServerName string    `json:"server_name,omitempty"`
}

ChatMessage represents a chat message from the player

type ClickHouseStatsResponse

type ClickHouseStatsResponse struct {
	DatabaseName string                 `json:"database_name"`
	TableCount   int                    `json:"table_count"`
	TotalRows    uint64                 `json:"total_rows"`
	TotalBytes   string                 `json:"total_bytes"`
	Tables       []ClickHouseTableStats `json:"tables"`
}

ClickHouseStatsResponse represents ClickHouse database statistics

type ClickHouseTableStats

type ClickHouseTableStats struct {
	TableName        string  `json:"table_name"`
	TotalRows        uint64  `json:"total_rows"`
	TotalBytes       string  `json:"total_bytes"`
	CompressedBytes  string  `json:"compressed_bytes"`
	CompressionRatio float64 `json:"compression_ratio"`
	PartitionCount   int     `json:"partition_count"`
}

ClickHouseTableStats represents statistics for a ClickHouse table

type CombatHistoryEntry

type CombatHistoryEntry struct {
	EventID      string    `json:"event_id,omitempty"`
	ChainID      string    `json:"chain_id,omitempty"`
	EventTime    time.Time `json:"event_time"`
	EventType    string    `json:"event_type"` // "kill", "death", "wounded", "damaged", "wounded_by", "damaged_by"
	ServerID     string    `json:"server_id"`
	ServerName   string    `json:"server_name,omitempty"`
	Weapon       string    `json:"weapon"`
	Damage       float32   `json:"damage"`
	Teamkill     bool      `json:"teamkill"`
	OtherName    string    `json:"other_name"`
	OtherSteamID string    `json:"other_steam_id,omitempty"`
	OtherEOSID   string    `json:"other_eos_id,omitempty"`
	OtherTeam    string    `json:"other_team"`
	OtherSquad   string    `json:"other_squad"`
	PlayerTeam   string    `json:"player_team"`
	PlayerSquad  string    `json:"player_squad"`
}

CombatHistoryEntry represents a kill or death event

type ConnectionMetricValue

type ConnectionMetricValue struct {
	Connections    int `json:"connections"`
	Disconnections int `json:"disconnections"`
	TotalActivity  int `json:"total_activity"`
}

type CreateRoleFromTemplateRequest

type CreateRoleFromTemplateRequest struct {
	TemplateId uuid.UUID `json:"template_id" binding:"required"`
	Name       string    `json:"name" binding:"required"`
}

ServerRoleCreateFromTemplate creates a new server role from a template

type DatabaseTableStats

type DatabaseTableStats struct {
	TableName    string `json:"table_name"`
	RowCount     int64  `json:"row_count"`
	TotalSize    string `json:"total_size"`
	DataSize     string `json:"data_size"`
	IndexSize    string `json:"index_size"`
	LastAnalyzed string `json:"last_analyzed,omitempty"`
}

DatabaseTableStats represents statistics for a database table

type Dependencies

type Dependencies struct {
	DB                   *sql.DB
	Clickhouse           *clickhouse.Client
	Valkey               *valkey.Client
	RconManager          *rcon_manager.RconManager
	EventManager         *event_manager.EventManager
	LogwatcherManager    *logwatcher_manager.LogwatcherManager
	PluginManager        *plugin_manager.PluginManager
	WorkflowManager      *workflow_manager.WorkflowManager
	RemoteBanSyncService *core.RemoteBanSyncService
	Storage              storage.Storage
	PermissionService    *permissions.Service
	PermissionRepo       *permissions.Repository
}

type FeedEvent

type FeedEvent struct {
	ID        string                 `json:"id"`
	Type      string                 `json:"type"`
	Timestamp time.Time              `json:"timestamp"`
	Data      map[string]interface{} `json:"data"`
}

FeedEvent represents a formatted event for the feeds

type GlobalAuditLogEntry

type GlobalAuditLogEntry struct {
	ID         uuid.UUID       `json:"id"`
	ServerID   *uuid.UUID      `json:"server_id,omitempty"`
	ServerName string          `json:"server_name,omitempty"`
	UserID     *uuid.UUID      `json:"user_id,omitempty"`
	Username   string          `json:"username,omitempty"`
	Action     string          `json:"action"`
	Changes    json.RawMessage `json:"changes,omitempty"`
	Timestamp  time.Time       `json:"timestamp"`
}

GlobalAuditLogEntry represents an audit log entry with server information

type GlobalAuditStatsResponse

type GlobalAuditStatsResponse struct {
	TotalLogs      int64                 `json:"total_logs"`
	LogsToday      int64                 `json:"logs_today"`
	LogsThisWeek   int64                 `json:"logs_this_week"`
	LogsThisMonth  int64                 `json:"logs_this_month"`
	TopActions     []ActionCount         `json:"top_actions"`
	TopUsers       []UserActionCount     `json:"top_users"`
	RecentActivity []GlobalAuditLogEntry `json:"recent_activity"`
}

GlobalAuditStatsResponse represents audit log statistics

type KickPlayerRequest

type KickPlayerRequest struct {
	SteamId string `json:"steam_id"`
	EosId   string `json:"eos_id"`
	Reason  string `json:"reason"`
}

Request structs for player actions

type LayerChangeRequest

type LayerChangeRequest struct {
	Layer string `json:"layer" binding:"required"`
}

type MetricPoint

type MetricPoint struct {
	Timestamp time.Time   `json:"timestamp"`
	Value     interface{} `json:"value"`
}

MetricPoint represents a time-series data point

type MetricsOverviewResponse

type MetricsOverviewResponse struct {
	TotalServers        int    `json:"total_servers"`
	ActiveServers       int    `json:"active_servers"`
	TotalPlayers        int64  `json:"total_players"`
	TotalEvents         int64  `json:"total_events"`
	EventsThisWeek      int64  `json:"events_this_week"`
	EventsThisMonth     int64  `json:"events_this_month"`
	TotalChatMessages   int64  `json:"total_chat_messages"`
	TotalWorkflowRuns   int64  `json:"total_workflow_runs"`
	StorageUsed         int64  `json:"storage_used"`
	StorageUsedReadable string `json:"storage_used_readable"`
}

MetricsOverviewResponse represents high-level instance metrics

type MetricsSummary

type MetricsSummary struct {
	TotalPlayers           int     `json:"total_players"`
	AvgTickRate            float64 `json:"avg_tick_rate"`
	TotalRounds            int     `json:"total_rounds"`
	UniquePlayersCount     int     `json:"unique_players_count"`
	TotalChatMessages      int     `json:"total_chat_messages"`
	TotalConnections       int     `json:"total_connections"` // Total connection activity (connects + disconnects)
	TotalTeamkills         int     `json:"total_teamkills"`
	TotalPlayerWounded     int     `json:"total_player_wounded"`
	TotalPlayerRevived     int     `json:"total_player_revived"`
	TotalPlayerPossess     int     `json:"total_player_possess"`
	TotalPlayerDied        int     `json:"total_player_died"`
	TotalPlayerDamaged     int     `json:"total_player_damaged"`
	TotalDeployableDamaged int     `json:"total_deployable_damaged"`
	TotalAdminBroadcasts   int     `json:"total_admin_broadcasts"`
	TotalPluginLogs        int     `json:"total_plugin_logs"`
	MostPlayedMap          string  `json:"most_played_map"`
	PeakPlayerCount        int     `json:"peak_player_count"`
}

MetricsSummary provides aggregate statistics

type MetricsTimelinePoint

type MetricsTimelinePoint struct {
	Timestamp string `json:"timestamp"`
	Value     int64  `json:"value"`
}

MetricsTimelinePoint represents a data point in a time series

type MetricsTimelineResponse

type MetricsTimelineResponse struct {
	EventsOverTime  []MetricsTimelinePoint `json:"events_over_time"`
	ChatOverTime    []MetricsTimelinePoint `json:"chat_over_time"`
	PlayersOverTime []MetricsTimelinePoint `json:"players_over_time"`
}

MetricsTimelineResponse represents time-series metrics data

type MovePlayerRequest

type MovePlayerRequest struct {
	SteamId string `json:"steam_id"`
	EosId   string `json:"eos_id"`
}

type NameHistoryEntry

type NameHistoryEntry struct {
	Name         string    `json:"name"`
	FirstUsed    time.Time `json:"first_used"`
	LastUsed     time.Time `json:"last_used"`
	SessionCount int64     `json:"session_count"`
}

NameHistoryEntry represents a name used by the player

type PaginatedChatHistory

type PaginatedChatHistory struct {
	Messages   []ChatMessage `json:"messages"`
	Total      int64         `json:"total"`
	Page       int           `json:"page"`
	Limit      int           `json:"limit"`
	TotalPages int           `json:"total_pages"`
}

PaginatedChatHistory represents paginated chat messages

type PlayerActionRequest

type PlayerActionRequest struct {
	SteamId string  `json:"steam_id"`
	EosId   string  `json:"eos_id"`
	RuleId  *string `json:"rule_id"`
}

Request structs for player actions with rule support

type PlayerActivity

type PlayerActivity struct {
	EventTime   time.Time `json:"event_time"`
	EventType   string    `json:"event_type"`
	Description string    `json:"description"`
	ServerID    string    `json:"server_id"`
	ServerName  string    `json:"server_name,omitempty"`
}

PlayerActivity represents a player action or event

type PlayerBanRequest

type PlayerBanRequest struct {
	PlayerActionRequest
	Reason   string `json:"reason" binding:"required"`
	Duration string `json:"duration"` // "0"/"permanent" for permanent, "7d", "2h", "30m", or bare number (days)
}

type PlayerIdentifier

type PlayerIdentifier struct {
	Value   string
	IsSteam bool
}

PlayerIdentifier represents a player identifier for batch lookups

type PlayerKickRequest

type PlayerKickRequest struct {
	PlayerActionRequest
	Reason string `json:"reason"`
}

type PlayerProfile

type PlayerProfile struct {
	SteamID        string             `json:"steam_id"`
	EOSID          string             `json:"eos_id"`
	EpicID         string             `json:"epic_id,omitempty"`
	PlayerName     string             `json:"player_name"`
	LastSeen       *time.Time         `json:"last_seen"`
	FirstSeen      *time.Time         `json:"first_seen"`
	TotalPlayTime  int64              `json:"total_play_time"` // in seconds
	TotalSessions  int64              `json:"total_sessions"`
	Statistics     PlayerStatistics   `json:"statistics"`
	RecentActivity []PlayerActivity   `json:"recent_activity"`
	ChatHistory    []ChatMessage      `json:"chat_history,omitempty"`
	Violations     []RuleViolation    `json:"violations,omitempty"`
	RecentServers  []RecentServerInfo `json:"recent_servers"`

	// Admin-focused fields
	ActiveBans       []ActiveBan        `json:"active_bans"`
	ViolationSummary ViolationSummary   `json:"violation_summary"`
	TeamkillMetrics  TeamkillMetrics    `json:"teamkill_metrics"`
	RiskIndicators   []RiskIndicator    `json:"risk_indicators"`
	NameHistory      []NameHistoryEntry `json:"name_history"`
	WeaponStats      []WeaponStat       `json:"weapon_stats"`

	// Consolidated identity fields
	CanonicalID    string   `json:"canonical_id,omitempty"`
	AllSteamIDs    []string `json:"all_steam_ids,omitempty"`
	AllEOSIDs      []string `json:"all_eos_ids,omitempty"`
	AllEpicIDs     []string `json:"all_epic_ids,omitempty"`
	AllNames       []string `json:"all_names,omitempty"`
	IdentityStatus string   `json:"identity_status,omitempty"` // "resolved", "pending"
}

PlayerProfile represents a player's comprehensive profile

type PlayerSearchResult

type PlayerSearchResult struct {
	SteamID    string     `json:"steam_id"`
	EOSID      string     `json:"eos_id"`
	EpicID     string     `json:"epic_id,omitempty"`
	PlayerName string     `json:"player_name"`
	LastSeen   *time.Time `json:"last_seen"`
	FirstSeen  *time.Time `json:"first_seen"`
}

PlayerSearchResult represents a simplified player profile for search results

type PlayerStatistics

type PlayerStatistics struct {
	Kills        int64   `json:"kills"`
	Deaths       int64   `json:"deaths"`
	Teamkills    int64   `json:"teamkills"`
	Revives      int64   `json:"revives"`
	TimesRevived int64   `json:"times_revived"`
	DamageDealt  float64 `json:"damage_dealt"`
	DamageTaken  float64 `json:"damage_taken"`
	KDRatio      float64 `json:"kd_ratio"`
}

PlayerStatistics holds combat and gameplay statistics

type PlayerStatsSummary

type PlayerStatsSummary struct {
	TopPlayers        []TopPlayerStats     `json:"top_players"`
	TopTeamkillers    []TopPlayerStats     `json:"top_teamkillers"`
	TopMedics         []TopPlayerStats     `json:"top_medics"`
	MostRecentPlayers []PlayerSearchResult `json:"most_recent_players"`
	TotalPlayers      int64                `json:"total_players"`
	TotalKills        int64                `json:"total_kills"`
	TotalDeaths       int64                `json:"total_deaths"`
	TotalTeamkills    int64                `json:"total_teamkills"`
}

PlayerStatsSummary represents overall player statistics

type PlayerWarnRequest

type PlayerWarnRequest struct {
	PlayerActionRequest
	Message string `json:"message" binding:"required"`
}

type PostgreSQLStatsResponse

type PostgreSQLStatsResponse struct {
	DatabaseName     string               `json:"database_name"`
	DatabaseSize     string               `json:"database_size"`
	TableCount       int                  `json:"table_count"`
	TotalConnections int                  `json:"total_connections"`
	ActiveQueries    int                  `json:"active_queries"`
	CacheHitRatio    float64              `json:"cache_hit_ratio"`
	Tables           []DatabaseTableStats `json:"tables"`
}

PostgreSQLStatsResponse represents PostgreSQL database statistics

type RecentJoin

type RecentJoin struct {
	ID         string    `json:"id"`
	PlayerName string    `json:"player_name"`
	SteamID    string    `json:"steam_id,omitempty"`
	EOSID      string    `json:"eos_id,omitempty"`
	JoinedAt   time.Time `json:"joined_at"`
}

RecentJoin represents a recent player join event

type RecentServerInfo

type RecentServerInfo struct {
	ServerID   string    `json:"server_id"`
	ServerName string    `json:"server_name"`
	LastSeen   time.Time `json:"last_seen"`
	Sessions   int64     `json:"sessions"`
}

RecentServerInfo represents a server the player has recently played on

type RelatedPlayer

type RelatedPlayer struct {
	SteamID        string `json:"steam_id"`
	EOSID          string `json:"eos_id"`
	PlayerName     string `json:"player_name"`
	RelationType   string `json:"relation_type"` // "same_ip"
	SharedSessions int64  `json:"shared_sessions"`
	IsBanned       bool   `json:"is_banned"`
}

RelatedPlayer represents a player potentially related (same IP)

type RiskIndicator

type RiskIndicator struct {
	Type        string `json:"type"`     // "high_tk_rate", "recent_ban", "multiple_names", "cbl_flagged", "ip_shared"
	Severity    string `json:"severity"` // "critical", "high", "medium", "low"
	Description string `json:"description"`
}

RiskIndicator represents a risk flag for admin attention

type RuleEscalationSuggestion

type RuleEscalationSuggestion struct {
	SuggestedAction   string  `json:"suggested_action"`   // WARN, KICK, BAN
	SuggestedDuration *int    `json:"suggested_duration"` // Duration in days for bans
	SuggestedMessage  string  `json:"suggested_message"`
	ViolationCount    int     `json:"violation_count"`
	RuleTitle         string  `json:"rule_title"`
	RuleDescription   string  `json:"rule_description"`
	RuleId            *string `json:"rule_id"` // Rule ID for generating reason in UI
}

RuleEscalationSuggestion represents a suggested escalation action

type RuleViolation

type RuleViolation struct {
	ViolationID string    `json:"violation_id"`
	ServerID    string    `json:"server_id"`
	ServerName  string    `json:"server_name,omitempty"`
	RuleID      *string   `json:"rule_id"`
	RuleName    *string   `json:"rule_name,omitempty"`
	ActionType  string    `json:"action_type"`
	AdminUserID *string   `json:"admin_user_id"`
	AdminName   *string   `json:"admin_name,omitempty"`
	CreatedAt   time.Time `json:"created_at"`
}

RuleViolation represents a rule violation by the player

type Server

type Server struct {
	Dependencies *Dependencies
	// contains filtered or unexported fields
}

func New

func New(serverDependencies *Dependencies) *Server

func (*Server) AuthHasAnyServerPermission

func (s *Server) AuthHasAnyServerPermission(perms ...string) gin.HandlerFunc

AuthHasAnyServerPermission checks if the user has any of the specified permissions for a server DEPRECATED: Use RequireAnyPermission instead for new code

func (*Server) AuthHasServerPermission

func (s *Server) AuthHasServerPermission(permission string) gin.HandlerFunc

AuthHasServerPermission checks if the user has a specific permission for a server This middleware expects the serverId to be in the URL parameters

func (*Server) AuthInitial

func (s *Server) AuthInitial(c *gin.Context)

func (*Server) AuthIsSuperAdmin

func (s *Server) AuthIsSuperAdmin() func(c *gin.Context)

AuthIsSuperAdmin checks if the user is a super admin, if not it returns a 403 Forbidden response

func (*Server) AuthLogin

func (s *Server) AuthLogin(c *gin.Context)

func (*Server) AuthLogout

func (s *Server) AuthLogout(c *gin.Context)

func (*Server) AuthSession

func (s *Server) AuthSession(c *gin.Context)

AuthSession checks if the user is authenticated, if not it returns a 401 Unauthorized response

func (*Server) BanListCfg

func (s *Server) BanListCfg(c *gin.Context)

BanListCfg handles generating a ban config for a specific ban list

func (*Server) BanListsCreate

func (s *Server) BanListsCreate(c *gin.Context)

BanListsCreate handles creating a new ban list

func (*Server) BanListsDelete

func (s *Server) BanListsDelete(c *gin.Context)

BanListsDelete handles deleting a ban list

func (*Server) BanListsGet

func (s *Server) BanListsGet(c *gin.Context)

BanListsGet handles getting a specific ban list

func (*Server) BanListsList

func (s *Server) BanListsList(c *gin.Context)

BanListsList handles listing all ban lists

func (*Server) BanListsUpdate

func (s *Server) BanListsUpdate(c *gin.Context)

BanListsUpdate handles updating a ban list

func (*Server) BulkDeleteStorageFiles

func (s *Server) BulkDeleteStorageFiles(c *gin.Context)

BulkDeleteStorageFiles deletes multiple files from storage

func (*Server) CleanupExpiredSessions

func (s *Server) CleanupExpiredSessions(c *gin.Context)

CleanupExpiredSessions removes all expired sessions from the database

func (*Server) ConnectorCreate

func (s *Server) ConnectorCreate(c *gin.Context)

ConnectorCreate creates a new connector instance

func (*Server) ConnectorDelete

func (s *Server) ConnectorDelete(c *gin.Context)

ConnectorDelete deletes a connector instance

func (*Server) ConnectorList

func (s *Server) ConnectorList(c *gin.Context)

ConnectorList returns all configured connectors

func (*Server) ConnectorListAvailable

func (s *Server) ConnectorListAvailable(c *gin.Context)

ConnectorListAvailable returns all available connector definitions

func (*Server) ConnectorPackageInstalledDelete

func (s *Server) ConnectorPackageInstalledDelete(c *gin.Context)

ConnectorPackageInstalledDelete removes an installed sideloaded connector package.

func (*Server) ConnectorPackageListInstalled

func (s *Server) ConnectorPackageListInstalled(c *gin.Context)

ConnectorPackageListInstalled lists globally installed sideloaded connector packages (native executable bundle).

func (*Server) ConnectorPackageUpload

func (s *Server) ConnectorPackageUpload(c *gin.Context)

ConnectorPackageUpload installs a sideloaded connector package (zip: manifest + native executable bundle) uploaded by a super admin.

func (*Server) ConnectorUpdate

func (s *Server) ConnectorUpdate(c *gin.Context)

ConnectorUpdate updates a connector's configuration

func (*Server) CreateAuditLog

func (s *Server) CreateAuditLog(ctx context.Context, serverID *uuid.UUID, userID *uuid.UUID, action string, changes interface{})

CreateAuditLog creates a new audit log entry

func (*Server) DeleteSession

func (s *Server) DeleteSession(c *gin.Context)

DeleteSession force logs out a specific session

func (*Server) DeleteStorageFile

func (s *Server) DeleteStorageFile(c *gin.Context)

DeleteStorageFile deletes a specific file from storage

func (*Server) DeleteUserSessions

func (s *Server) DeleteUserSessions(c *gin.Context)

DeleteUserSessions force logs out all sessions for a specific user

func (*Server) DownloadStorageFile

func (s *Server) DownloadStorageFile(c *gin.Context)

DownloadStorageFile downloads a specific file from storage

func (*Server) ExportGlobalAuditLogs

func (s *Server) ExportGlobalAuditLogs(c *gin.Context)

ExportGlobalAuditLogs exports audit logs to CSV format

func (*Server) GetAllSessions

func (s *Server) GetAllSessions(c *gin.Context)

GetAllSessions returns all active sessions

func (*Server) GetAvatar

func (s *Server) GetAvatar(c *gin.Context)

func (*Server) GetClickHouseStats

func (s *Server) GetClickHouseStats(c *gin.Context)

GetClickHouseStats returns ClickHouse database statistics

func (*Server) GetDatabaseOverview

func (s *Server) GetDatabaseOverview(c *gin.Context)

GetDatabaseOverview returns a combined overview of all databases

func (*Server) GetGlobalAuditLogs

func (s *Server) GetGlobalAuditLogs(c *gin.Context)

GetGlobalAuditLogs returns audit logs across all servers

func (*Server) GetGlobalAuditStats

func (s *Server) GetGlobalAuditStats(c *gin.Context)

GetGlobalAuditStats returns statistics about audit logs

func (*Server) GetMetricsOverview

func (s *Server) GetMetricsOverview(c *gin.Context)

GetMetricsOverview returns high-level instance metrics

func (*Server) GetMetricsTimeline

func (s *Server) GetMetricsTimeline(c *gin.Context)

GetMetricsTimeline returns time-series metrics data

func (*Server) GetPostgreSQLStats

func (s *Server) GetPostgreSQLStats(c *gin.Context)

GetPostgreSQLStats returns PostgreSQL database statistics

func (*Server) GetServerActivities

func (s *Server) GetServerActivities(c *gin.Context)

GetServerActivities returns per-server activity breakdown

func (*Server) GetSessionStats

func (s *Server) GetSessionStats(c *gin.Context)

GetSessionStats returns session statistics

func (*Server) GetStorageFiles

func (s *Server) GetStorageFiles(c *gin.Context)

GetStorageFiles returns a paginated list of files in storage

func (*Server) GetStorageSummary

func (s *Server) GetStorageSummary(c *gin.Context)

GetStorageSummary returns storage usage statistics

func (*Server) GetSystemConfig

func (s *Server) GetSystemConfig(c *gin.Context)

GetSystemConfig returns sanitized system configuration

func (*Server) GetSystemHealth

func (s *Server) GetSystemHealth(c *gin.Context)

GetSystemHealth returns overall system health status

func (*Server) GetTopServers

func (s *Server) GetTopServers(c *gin.Context)

GetTopServers returns the most active servers by various metrics

func (*Server) GetUserServerPermissions

func (s *Server) GetUserServerPermissions(c *gin.Context, userId, serverId uuid.UUID) ([]string, error)

GetUserServerPermissions retrieves the permissions a user has for a specific server Uses the new PBAC system (server_role_permissions table)

func (*Server) HasAnyServerPermission

func (s *Server) HasAnyServerPermission(c *gin.Context, user *models.User, serverId uuid.UUID, permissions ...string) bool

HasAnyServerPermission checks if a user has any of the specified permissions for a server

func (*Server) HasServerPermission

func (s *Server) HasServerPermission(c *gin.Context, user *models.User, serverId uuid.UUID, permission string) bool

HasServerPermission checks if a user has a specific permission for a server

func (*Server) IgnoredSteamIDsCheck

func (s *Server) IgnoredSteamIDsCheck(c *gin.Context)

IgnoredSteamIDsCheck checks if a Steam ID is in the ignore list

func (*Server) IgnoredSteamIDsCreate

func (s *Server) IgnoredSteamIDsCreate(c *gin.Context)

IgnoredSteamIDsCreate creates a new ignored Steam ID entry

func (*Server) IgnoredSteamIDsDelete

func (s *Server) IgnoredSteamIDsDelete(c *gin.Context)

IgnoredSteamIDsDelete deletes an ignored Steam ID entry

func (*Server) IgnoredSteamIDsList

func (s *Server) IgnoredSteamIDsList(c *gin.Context)

IgnoredSteamIDsList returns all ignored Steam IDs

func (*Server) IgnoredSteamIDsUpdate

func (s *Server) IgnoredSteamIDsUpdate(c *gin.Context)

IgnoredSteamIDsUpdate updates an existing ignored Steam ID entry

func (*Server) OptimizeDatabase

func (s *Server) OptimizeDatabase(c *gin.Context)

OptimizeDatabase performs optimization tasks on databases

func (*Server) OptionalAuthSession

func (s *Server) OptionalAuthSession(c *gin.Context)

OptionalAuthSession checks if the user is authenticated, but does not require it

func (*Server) PermissionsList

func (s *Server) PermissionsList(c *gin.Context)

PermissionsList returns all available permissions grouped by category

func (*Server) PlayerBanHistory

func (s *Server) PlayerBanHistory(c *gin.Context)

PlayerBanHistory handles GET /api/players/:playerId/ban-history - historical bans for a player by Steam or EOS identifier.

func (*Server) PlayerChatHistoryPaginated

func (s *Server) PlayerChatHistoryPaginated(c *gin.Context)

PlayerChatHistoryPaginated handles GET /api/players/:playerId/chat - paginated chat history

func (*Server) PlayerCombatHistory

func (s *Server) PlayerCombatHistory(c *gin.Context)

PlayerCombatHistory handles GET /api/players/:playerId/combat - combat history (kills and deaths)

func (*Server) PlayerGet

func (s *Server) PlayerGet(c *gin.Context)

PlayerGet handles GET /api/players/:playerId - get player profile by steam or eos id

func (*Server) PlayerRelatedPlayers

func (s *Server) PlayerRelatedPlayers(c *gin.Context)

PlayerRelatedPlayers handles GET /api/players/:playerId/related - related players (same IP)

func (*Server) PlayerSessionHistory

func (s *Server) PlayerSessionHistory(c *gin.Context)

PlayerSessionHistory handles GET /api/players/:playerId/sessions - session history

func (*Server) PlayerTeamkillsAnalysis

func (s *Server) PlayerTeamkillsAnalysis(c *gin.Context)

PlayerTeamkillsAnalysis handles GET /api/players/:playerId/teamkills - teamkill analysis

func (*Server) PlayersAltGroups

func (s *Server) PlayersAltGroups(c *gin.Context)

PlayersAltGroups handles GET /api/players/alt-groups - list all suspected alt account groups

func (*Server) PlayersList

func (s *Server) PlayersList(c *gin.Context)

PlayersList handles GET /api/players - search and list players

func (*Server) PlayersStats

func (s *Server) PlayersStats(c *gin.Context)

PlayersStats handles GET /api/players/stats - get player statistics summary

func (*Server) PluginInstalledDelete

func (s *Server) PluginInstalledDelete(c *gin.Context)

PluginInstalledDelete removes an installed native plugin package.

func (*Server) PluginListAvailable

func (s *Server) PluginListAvailable(c *gin.Context)

PluginListAvailable returns all available plugin definitions

func (*Server) PluginListInstalled

func (s *Server) PluginListInstalled(c *gin.Context)

PluginListInstalled returns all globally installed plugin packages.

func (*Server) PluginUpload

func (s *Server) PluginUpload(c *gin.Context)

PluginUpload installs a plugin package uploaded by a super admin.

func (*Server) RconCommandAutocomplete

func (s *Server) RconCommandAutocomplete(c *gin.Context)

RconCommandAutocomplete handles the auto-complete functionality for commands

func (*Server) RconCommandList

func (s *Server) RconCommandList(c *gin.Context)

RconCommandList handles the listing of all commands that can be executed by the server

func (*Server) RemoteBanSourcesCreate

func (s *Server) RemoteBanSourcesCreate(c *gin.Context)

RemoteBanSourcesCreate handles creating a new remote ban source

func (*Server) RemoteBanSourcesDelete

func (s *Server) RemoteBanSourcesDelete(c *gin.Context)

RemoteBanSourcesDelete handles deleting a remote ban source

func (*Server) RemoteBanSourcesList

func (s *Server) RemoteBanSourcesList(c *gin.Context)

RemoteBanSourcesList handles listing all remote ban sources

func (*Server) RemoteBanSourcesUpdate

func (s *Server) RemoteBanSourcesUpdate(c *gin.Context)

RemoteBanSourcesUpdate handles updating a remote ban source

func (*Server) RequireAllPermissions

func (s *Server) RequireAllPermissions(perms ...permissions.Permission) gin.HandlerFunc

RequireAllPermissions checks if the user has all of the specified permissions

func (*Server) RequireAnyPermission

func (s *Server) RequireAnyPermission(perms ...permissions.Permission) gin.HandlerFunc

RequireAnyPermission checks if the user has any of the specified permissions

func (*Server) RequirePermission

func (s *Server) RequirePermission(perm permissions.Permission) gin.HandlerFunc

RequirePermission checks if the user has a specific permission for a server This is the new PBAC middleware that uses the permissions package

func (*Server) RoleTemplatesList

func (s *Server) RoleTemplatesList(c *gin.Context)

RoleTemplatesList returns all available role templates with their permissions

func (*Server) ServerAdminsAdd

func (s *Server) ServerAdminsAdd(c *gin.Context)

ServerAdminsAdd handles adding a new admin

func (*Server) ServerAdminsCfg

func (s *Server) ServerAdminsCfg(c *gin.Context)

ServerAdminsCfg handles generating the admin config file This exports roles and admins in Squad's admin.cfg format

func (*Server) ServerAdminsCleanupExpired

func (s *Server) ServerAdminsCleanupExpired(c *gin.Context)

ServerAdminsCleanupExpired handles manual cleanup of expired admin roles

func (*Server) ServerAdminsList

func (s *Server) ServerAdminsList(c *gin.Context)

ServerAdminsList handles listing all admins for a server

func (*Server) ServerAdminsRemove

func (s *Server) ServerAdminsRemove(c *gin.Context)

ServerAdminsRemove handles removing an admin

func (*Server) ServerAdminsUpdate

func (s *Server) ServerAdminsUpdate(c *gin.Context)

ServerAdminsUpdate handles updating an admin's notes

func (*Server) ServerAuditLogs

func (s *Server) ServerAuditLogs(c *gin.Context)

ServerAuditLogs handles listing audit logs for a server

func (*Server) ServerBanImportExecute

func (s *Server) ServerBanImportExecute(c *gin.Context)

ServerBanImportExecute imports bans from the server's Bans.cfg into the Aegis database.

func (*Server) ServerBanImportPreview

func (s *Server) ServerBanImportPreview(c *gin.Context)

ServerBanImportPreview returns a preview of what would be imported from the server's Bans.cfg.

func (*Server) ServerBanListSubscriptionCreate

func (s *Server) ServerBanListSubscriptionCreate(c *gin.Context)

ServerBanListSubscriptionCreate handles subscribing a server to a ban list

func (*Server) ServerBanListSubscriptionDelete

func (s *Server) ServerBanListSubscriptionDelete(c *gin.Context)

ServerBanListSubscriptionDelete handles unsubscribing a server from a ban list

func (*Server) ServerBanListSubscriptions

func (s *Server) ServerBanListSubscriptions(c *gin.Context)

ServerBanListSubscriptions handles listing ban list subscriptions for a server

func (*Server) ServerBansAdd

func (s *Server) ServerBansAdd(c *gin.Context)

ServerBansAdd handles adding a new ban

func (*Server) ServerBansCfg

func (s *Server) ServerBansCfg(c *gin.Context)

ServerBansCfg handles generating the ban config file for the server

func (*Server) ServerBansCfgEnhanced

func (s *Server) ServerBansCfgEnhanced(c *gin.Context)

ServerBansCfgEnhanced handles generating the enhanced ban config file for the server This supports both local bans and remote ban list integration

func (*Server) ServerBansList

func (s *Server) ServerBansList(c *gin.Context)

ServerBansList handles listing all bans for a server

func (*Server) ServerBansRemove

func (s *Server) ServerBansRemove(c *gin.Context)

ServerBansRemove handles removing a ban

func (*Server) ServerBansUpdate

func (s *Server) ServerBansUpdate(c *gin.Context)

ServerBansUpdate handles updating an existing ban

func (*Server) ServerDelete

func (s *Server) ServerDelete(c *gin.Context)

ServerDelete handles deleting a server

func (*Server) ServerEventsSearch

func (s *Server) ServerEventsSearch(c *gin.Context)

ServerEventsSearch handles searching for events in ClickHouse for evidence

func (*Server) ServerEvidenceFileDownload

func (s *Server) ServerEvidenceFileDownload(c *gin.Context)

ServerEvidenceFileDownload handles downloading evidence files

func (*Server) ServerEvidenceFileUpload

func (s *Server) ServerEvidenceFileUpload(c *gin.Context)

ServerEvidenceFileUpload handles file uploads for ban evidence

func (*Server) ServerFeeds

func (s *Server) ServerFeeds(c *gin.Context)

ServerFeeds handles subscribing to live server events for feeds (chat, connections, teamkills) via WebSocket

func (*Server) ServerFeedsHistory

func (s *Server) ServerFeedsHistory(c *gin.Context)

ServerFeedsHistory returns historical feed data

func (*Server) ServerGet

func (s *Server) ServerGet(c *gin.Context)

ServerGet handles retrieving a single server by ID

func (*Server) ServerLogwatcherRestart

func (s *Server) ServerLogwatcherRestart(c *gin.Context)

ServerLogwatcherRestart handles restarting the log watcher connection for a server

func (*Server) ServerMetrics

func (s *Server) ServerMetrics(c *gin.Context)

ServerMetrics handles getting the metrics of a server

func (*Server) ServerMetricsHistory

func (s *Server) ServerMetricsHistory(c *gin.Context)

ServerMetricsHistory provides detailed metrics history from ClickHouse

func (*Server) ServerPluginCommandExecute

func (s *Server) ServerPluginCommandExecute(c *gin.Context)

ServerPluginCommandExecute executes a command on a plugin instance

func (*Server) ServerPluginCommandStatus

func (s *Server) ServerPluginCommandStatus(c *gin.Context)

ServerPluginCommandStatus gets async command execution status

func (*Server) ServerPluginCommandsList

func (s *Server) ServerPluginCommandsList(c *gin.Context)

ServerPluginCommandsList returns available commands for a plugin instance

func (*Server) ServerPluginCreate

func (s *Server) ServerPluginCreate(c *gin.Context)

ServerPluginCreate creates a new plugin instance for a server

func (*Server) ServerPluginDataClear

func (s *Server) ServerPluginDataClear(c *gin.Context)

ServerPluginDataClear clears all plugin data for a plugin instance

func (*Server) ServerPluginDataDelete

func (s *Server) ServerPluginDataDelete(c *gin.Context)

ServerPluginDataDelete deletes a specific plugin data item

func (*Server) ServerPluginDataGet

func (s *Server) ServerPluginDataGet(c *gin.Context)

ServerPluginDataGet returns all plugin data for a plugin instance

func (*Server) ServerPluginDataSet

func (s *Server) ServerPluginDataSet(c *gin.Context)

ServerPluginDataSet sets or updates a plugin data item

func (*Server) ServerPluginDelete

func (s *Server) ServerPluginDelete(c *gin.Context)

ServerPluginDelete deletes a plugin instance

func (*Server) ServerPluginDisable

func (s *Server) ServerPluginDisable(c *gin.Context)

ServerPluginDisable disables a plugin instance

func (*Server) ServerPluginEnable

func (s *Server) ServerPluginEnable(c *gin.Context)

ServerPluginEnable enables a plugin instance

func (*Server) ServerPluginGet

func (s *Server) ServerPluginGet(c *gin.Context)

ServerPluginGet returns a specific plugin instance

func (*Server) ServerPluginList

func (s *Server) ServerPluginList(c *gin.Context)

ServerPluginList returns all plugin instances for a server

func (*Server) ServerPluginLogs

func (s *Server) ServerPluginLogs(c *gin.Context)

ServerPluginLogs returns recent logs for a plugin instance

func (*Server) ServerPluginLogsAll

func (s *Server) ServerPluginLogsAll(c *gin.Context)

ServerPluginLogsAll returns aggregated logs for all plugin instances for a server

func (*Server) ServerPluginLogsAllWebSocket

func (s *Server) ServerPluginLogsAllWebSocket(c *gin.Context)

ServerPluginLogsAllWebSocket handles WebSocket connections for real-time logs from all plugin instances on a server

func (*Server) ServerPluginLogsWebSocket

func (s *Server) ServerPluginLogsWebSocket(c *gin.Context)

ServerPluginLogsWebSocket handles WebSocket connections for real-time plugin logs for a specific plugin instance

func (*Server) ServerPluginMetrics

func (s *Server) ServerPluginMetrics(c *gin.Context)

ServerPluginMetrics returns metrics for a plugin instance. The body is currently empty; the route is kept for client compatibility while plugin metrics are reworked. Use the logs endpoints for per-plugin runtime data.

func (*Server) ServerPluginUpdate

func (s *Server) ServerPluginUpdate(c *gin.Context)

ServerPluginUpdate updates a plugin instance's configuration and settings

func (*Server) ServerRconAvailableLayers

func (s *Server) ServerRconAvailableLayers(c *gin.Context)

func (*Server) ServerRconChangeLayer

func (s *Server) ServerRconChangeLayer(c *gin.Context)

func (*Server) ServerRconEvents

func (s *Server) ServerRconEvents(c *gin.Context)

ServerRconEvents handles subscribing to RCON events using Server-Sent Events (SSE)

func (*Server) ServerRconExecute

func (s *Server) ServerRconExecute(c *gin.Context)

func (*Server) ServerRconForceRestart

func (s *Server) ServerRconForceRestart(c *gin.Context)

ServerRconForceRestart forces a restart of the RCON connection for a server

func (*Server) ServerRconKickPlayer

func (s *Server) ServerRconKickPlayer(c *gin.Context)

ServerRconKickPlayer handles kicking a player from the server

func (*Server) ServerRconMovePlayer

func (s *Server) ServerRconMovePlayer(c *gin.Context)

ServerRconMovePlayer handles moving a player to another team

func (*Server) ServerRconPlayerBan

func (s *Server) ServerRconPlayerBan(c *gin.Context)

ServerRconPlayerBan handles banning a player via RCON with optional rule violation logging

func (*Server) ServerRconPlayerEscalationSuggestion

func (s *Server) ServerRconPlayerEscalationSuggestion(c *gin.Context)

ServerRconPlayerEscalationSuggestion checks what action should be taken for a player based on rule violations

func (*Server) ServerRconPlayerKick

func (s *Server) ServerRconPlayerKick(c *gin.Context)

ServerRconPlayerKick handles kicking a player via RCON with optional rule violation logging

func (*Server) ServerRconPlayerWarn

func (s *Server) ServerRconPlayerWarn(c *gin.Context)

ServerRconPlayerWarn handles warning a player via RCON with optional rule violation logging

func (*Server) ServerRconServerInfo

func (s *Server) ServerRconServerInfo(c *gin.Context)

ServerRconServerInfo gets the server info from the server

func (*Server) ServerRconServerPopulation

func (s *Server) ServerRconServerPopulation(c *gin.Context)

func (*Server) ServerRconSetNextLayer

func (s *Server) ServerRconSetNextLayer(c *gin.Context)

func (*Server) ServerRconWarnPlayer

func (s *Server) ServerRconWarnPlayer(c *gin.Context)

ServerRconWarnPlayer handles sending a warning message to a player

func (*Server) ServerRecentJoins

func (s *Server) ServerRecentJoins(c *gin.Context)

ServerRecentJoins returns the most recent player joins for a server

func (*Server) ServerRoleCreateFromTemplate

func (s *Server) ServerRoleCreateFromTemplate(c *gin.Context)

func (*Server) ServerRolePermissionsGet

func (s *Server) ServerRolePermissionsGet(c *gin.Context)

ServerRolePermissionsGet retrieves permissions for a specific server role

func (*Server) ServerRolePermissionsUpdate

func (s *Server) ServerRolePermissionsUpdate(c *gin.Context)

func (*Server) ServerRolesAdd

func (s *Server) ServerRolesAdd(c *gin.Context)

ServerRolesAdd handles adding a new role

func (*Server) ServerRolesList

func (s *Server) ServerRolesList(c *gin.Context)

ServerRolesList handles listing all roles for a server

func (*Server) ServerRolesRemove

func (s *Server) ServerRolesRemove(c *gin.Context)

ServerRolesRemove handles removing a role

func (*Server) ServerRolesUpdate

func (s *Server) ServerRolesUpdate(c *gin.Context)

ServerRolesUpdate handles updating a role

func (*Server) ServerStatus

func (s *Server) ServerStatus(c *gin.Context)

ServerStatus handles getting the status of a server

func (*Server) ServerUpdate

func (s *Server) ServerUpdate(c *gin.Context)

ServerUpdate handles updating a server

func (*Server) ServerUserRoles

func (s *Server) ServerUserRoles(c *gin.Context)

ServerUserRoles handles retrieving the user's permissions for all servers they have access to

func (*Server) ServerWorkflowCreate

func (s *Server) ServerWorkflowCreate(c *gin.Context)

ServerWorkflowCreate creates a new workflow

func (*Server) ServerWorkflowDelete

func (s *Server) ServerWorkflowDelete(c *gin.Context)

ServerWorkflowDelete deletes a workflow

func (*Server) ServerWorkflowExecutionGet

func (s *Server) ServerWorkflowExecutionGet(c *gin.Context)

ServerWorkflowExecutionGet returns details for a specific execution

func (*Server) ServerWorkflowExecutionLogs

func (s *Server) ServerWorkflowExecutionLogs(c *gin.Context)

ServerWorkflowExecutionLogs returns detailed logs for a specific execution

func (*Server) ServerWorkflowExecutionMessages

func (s *Server) ServerWorkflowExecutionMessages(c *gin.Context)

ServerWorkflowExecutionMessages returns workflow log messages for a specific execution

func (*Server) ServerWorkflowExecutionStats

func (s *Server) ServerWorkflowExecutionStats(c *gin.Context)

ServerWorkflowExecutionStats returns computed statistics for a workflow

func (*Server) ServerWorkflowExecutions

func (s *Server) ServerWorkflowExecutions(c *gin.Context)

ServerWorkflowExecutions returns execution history for a workflow

func (*Server) ServerWorkflowGet

func (s *Server) ServerWorkflowGet(c *gin.Context)

ServerWorkflowGet returns a specific workflow

func (*Server) ServerWorkflowKVClear

func (s *Server) ServerWorkflowKVClear(c *gin.Context)

ServerWorkflowKVClear clears all KV pairs for a workflow

func (*Server) ServerWorkflowKVDelete

func (s *Server) ServerWorkflowKVDelete(c *gin.Context)

ServerWorkflowKVDelete deletes a KV pair

func (*Server) ServerWorkflowKVGet

func (s *Server) ServerWorkflowKVGet(c *gin.Context)

ServerWorkflowKVGet gets a specific KV pair

func (*Server) ServerWorkflowKVList

func (s *Server) ServerWorkflowKVList(c *gin.Context)

ServerWorkflowKVList lists all KV pairs for a workflow

func (*Server) ServerWorkflowKVSet

func (s *Server) ServerWorkflowKVSet(c *gin.Context)

ServerWorkflowKVSet sets a KV pair

func (*Server) ServerWorkflowUpdate

func (s *Server) ServerWorkflowUpdate(c *gin.Context)

ServerWorkflowUpdate updates a workflow

func (*Server) ServerWorkflowVariableCreate

func (s *Server) ServerWorkflowVariableCreate(c *gin.Context)

ServerWorkflowVariableCreate creates a new workflow variable

func (*Server) ServerWorkflowVariableDelete

func (s *Server) ServerWorkflowVariableDelete(c *gin.Context)

ServerWorkflowVariableDelete deletes a workflow variable

func (*Server) ServerWorkflowVariableUpdate

func (s *Server) ServerWorkflowVariableUpdate(c *gin.Context)

ServerWorkflowVariableUpdate updates a workflow variable

func (*Server) ServerWorkflowVariablesList

func (s *Server) ServerWorkflowVariablesList(c *gin.Context)

ServerWorkflowVariablesList returns variables for a workflow

func (*Server) ServerWorkflowsList

func (s *Server) ServerWorkflowsList(c *gin.Context)

ServerWorkflowsList returns all workflows for a server

func (*Server) ServersCreate

func (s *Server) ServersCreate(c *gin.Context)

func (*Server) ServersList

func (s *Server) ServersList(c *gin.Context)

func (*Server) SyncBansCfgByID

func (s *Server) SyncBansCfgByID(ctx context.Context, serverID uuid.UUID) error

SyncBansCfgByID looks up a server by ID and regenerates its Bans.cfg. Intended for use as a callback from plugin/workflow ban paths.

func (*Server) TriggerMOTDUploadIfEnabled

func (s *Server) TriggerMOTDUploadIfEnabled(ctx context.Context, serverID uuid.UUID) bool

TriggerMOTDUploadIfEnabled is exported for use by rules bulk update. Returns true if upload was triggered, false otherwise.

func (*Server) UpdateUserPassword

func (s *Server) UpdateUserPassword(c *gin.Context)

func (*Server) UpdateUserProfile

func (s *Server) UpdateUserProfile(c *gin.Context)

func (*Server) UserCreate

func (s *Server) UserCreate(c *gin.Context)

func (*Server) UserDelete

func (s *Server) UserDelete(c *gin.Context)

func (*Server) UserUpdate

func (s *Server) UserUpdate(c *gin.Context)

func (*Server) UsersList

func (s *Server) UsersList(c *gin.Context)

type ServerActivityResponse

type ServerActivityResponse struct {
	ServerID       string  `json:"server_id"`
	ServerName     string  `json:"server_name"`
	TotalEvents    int64   `json:"total_events"`
	ChatMessages   int64   `json:"chat_messages"`
	UniquePlayers  int64   `json:"unique_players"`
	WorkflowRuns   int64   `json:"workflow_runs"`
	AvgPlayerCount float64 `json:"avg_player_count"`
	LastActivity   string  `json:"last_activity"`
}

ServerActivityResponse represents per-server activity metrics

type ServerMetricsData

type ServerMetricsData struct {
	PlayerCount            []MetricPoint  `json:"player_count"`
	QueueCount             []MetricPoint  `json:"queue_count"`
	TickRate               []MetricPoint  `json:"tick_rate"`
	Rounds                 []MetricPoint  `json:"rounds"`
	Maps                   []MetricPoint  `json:"maps"`
	ChatActivity           []MetricPoint  `json:"chat_activity"`
	ConnectionStats        []MetricPoint  `json:"connection_stats"` // Connection activity (connects + disconnects)
	TeamkillStats          []MetricPoint  `json:"teamkill_stats"`
	PlayerWoundedStats     []MetricPoint  `json:"player_wounded_stats"`
	PlayerRevivedStats     []MetricPoint  `json:"player_revived_stats"`
	PlayerPossessStats     []MetricPoint  `json:"player_possess_stats"`
	PlayerDiedStats        []MetricPoint  `json:"player_died_stats"`
	PlayerDamagedStats     []MetricPoint  `json:"player_damaged_stats"`
	DeployableDamagedStats []MetricPoint  `json:"deployable_damaged_stats"`
	AdminBroadcastStats    []MetricPoint  `json:"admin_broadcast_stats"`
	Period                 string         `json:"period"`
	Summary                MetricsSummary `json:"summary"`
}

ServerMetricsData represents the metrics response

type SessionHistoryEntry

type SessionHistoryEntry struct {
	ConnectTime       time.Time  `json:"connect_time"`
	DisconnectTime    *time.Time `json:"disconnect_time,omitempty"`
	DurationSeconds   *int64     `json:"duration_seconds,omitempty"`
	ServerID          string     `json:"server_id"`
	ServerName        string     `json:"server_name,omitempty"`
	IP                string     `json:"ip,omitempty"` // Only visible with permission
	MissingDisconnect bool       `json:"missing_disconnect"`
	Ongoing           bool       `json:"ongoing"`
}

SessionHistoryEntry represents a paired connection session

type SessionInfo

type SessionInfo struct {
	ID            uuid.UUID  `json:"id"`
	UserID        uuid.UUID  `json:"user_id"`
	Username      string     `json:"username"`
	Token         string     `json:"token"` // Masked for security
	CreatedAt     time.Time  `json:"created_at"`
	ExpiresAt     *time.Time `json:"expires_at,omitempty"`
	LastSeen      time.Time  `json:"last_seen"`
	LastSeenIP    string     `json:"last_seen_ip"`
	IsExpired     bool       `json:"is_expired"`
	TimeRemaining string     `json:"time_remaining"`
}

SessionInfo represents session information for display

type SessionStatsResponse

type SessionStatsResponse struct {
	TotalSessions   int                `json:"total_sessions"`
	ActiveSessions  int                `json:"active_sessions"`
	ExpiredSessions int                `json:"expired_sessions"`
	SessionsByUser  []UserSessionCount `json:"sessions_by_user"`
}

SessionStatsResponse represents session statistics

type StorageFileResponse

type StorageFileResponse struct {
	Path         string `json:"path"`
	Size         int64  `json:"size"`
	SizeReadable string `json:"size_readable"`
	ModifiedTime string `json:"modified_time"`
	IsDir        bool   `json:"is_dir"`
	Extension    string `json:"extension"`
}

StorageFileResponse represents a file in storage

type StorageSummaryResponse

type StorageSummaryResponse struct {
	TotalSize         int64                 `json:"total_size"`
	TotalSizeReadable string                `json:"total_size_readable"`
	TotalFiles        int64                 `json:"total_files"`
	FilesByType       map[string]int        `json:"files_by_type"`
	SizeByType        map[string]int64      `json:"size_by_type"`
	StorageType       string                `json:"storage_type"`
	RecentFiles       []StorageFileResponse `json:"recent_files"`
}

StorageSummaryResponse represents storage usage statistics

type SystemConfigResponse

type SystemConfigResponse struct {
	App        gin.H `json:"app"`
	Database   gin.H `json:"database"`
	ClickHouse gin.H `json:"clickhouse"`
	Valkey     gin.H `json:"valkey"`
	Storage    gin.H `json:"storage"`
	Plugins    gin.H `json:"plugins"`
	Log        gin.H `json:"log"`
}

SystemConfigResponse represents sanitized configuration

type SystemHealthResponse

type SystemHealthResponse struct {
	PostgreSQL SystemServiceHealth `json:"postgresql"`
	ClickHouse SystemServiceHealth `json:"clickhouse"`
	Valkey     SystemServiceHealth `json:"valkey"`
	Storage    SystemServiceHealth `json:"storage"`
	Overall    string              `json:"overall"`
}

SystemHealthResponse represents overall system health status

type SystemServiceHealth

type SystemServiceHealth struct {
	Status  string `json:"status"`  // healthy, degraded, unhealthy
	Latency int64  `json:"latency"` // in milliseconds
	Message string `json:"message"`
	Details gin.H  `json:"details,omitempty"`
}

SystemServiceHealth represents health status of a system service

type TeamkillMetrics

type TeamkillMetrics struct {
	TotalTeamkills      int64   `json:"total_teamkills"`
	TeamkillsPerSession float64 `json:"teamkills_per_session"`
	TeamkillRatio       float64 `json:"teamkill_ratio"`     // TKs / total kills
	RecentTeamkills     int64   `json:"recent_teamkills"`   // Last 7 days
	TotalTeamWounds     int64   `json:"total_team_wounds"`  // Times downed a teammate
	TotalTeamDamage     int64   `json:"total_team_damage"`  // Times damaged a teammate
	RecentTeamWounds    int64   `json:"recent_team_wounds"` // Team wounds in last 7 days
	RecentTeamDamage    int64   `json:"recent_team_damage"` // Team damage in last 7 days
}

TeamkillMetrics represents detailed teamkill statistics

type TeamkillVictim

type TeamkillVictim struct {
	VictimName  string    `json:"victim_name"`
	VictimSteam string    `json:"victim_steam"`
	VictimEOS   string    `json:"victim_eos"`
	TKCount     int64     `json:"tk_count"`
	WeaponsUsed []string  `json:"weapons_used"`
	FirstTK     time.Time `json:"first_tk"`
	LastTK      time.Time `json:"last_tk"`
}

TeamkillVictim represents a player who was teamkilled

type TopPlayerStats

type TopPlayerStats struct {
	SteamID    string  `json:"steam_id"`
	EOSID      string  `json:"eos_id"`
	PlayerName string  `json:"player_name"`
	Kills      int64   `json:"kills"`
	Deaths     int64   `json:"deaths"`
	KDRatio    float64 `json:"kd_ratio"`
	Teamkills  int64   `json:"teamkills"`
	Revives    int64   `json:"revives"`
}

TopPlayerStats represents a player in top statistics

type TopServersResponse

type TopServersResponse struct {
	ByEvents   []ServerActivityResponse `json:"by_events"`
	ByPlayers  []ServerActivityResponse `json:"by_players"`
	ByMessages []ServerActivityResponse `json:"by_messages"`
}

TopServersResponse represents the most active servers

type UpdatePasswordRequest

type UpdatePasswordRequest struct {
	CurrentPassword string `json:"currentPassword" binding:"required"`
	NewPassword     string `json:"newPassword" binding:"required,min=8"`
}

type UpdateProfileRequest

type UpdateProfileRequest struct {
	Name    string `json:"name" binding:"required"`
	SteamId string `json:"steam_id"`
}

type UpdateRolePermissionsRequest

type UpdateRolePermissionsRequest struct {
	Permissions []string `json:"permissions" binding:"required"`
}

ServerRolePermissionsUpdate updates permissions for a specific server role

type UserActionCount

type UserActionCount struct {
	UserID   uuid.UUID `json:"user_id"`
	Username string    `json:"username"`
	Count    int64     `json:"count"`
}

UserActionCount represents count of actions by user

type UserCreateRequest

type UserCreateRequest struct {
	SteamId    string `json:"steam_id" binding:"required"`
	Name       string `json:"name" binding:"required"`
	Username   string `json:"username" binding:"required"`
	Password   string `json:"password" binding:"required"`
	SuperAdmin bool   `json:"super_admin"`
}

type UserSessionCount

type UserSessionCount struct {
	UserID       uuid.UUID `json:"user_id"`
	Username     string    `json:"username"`
	SessionCount int       `json:"session_count"`
}

UserSessionCount represents session count per user

type UserUpdateRequest

type UserUpdateRequest struct {
	SteamId    string `json:"steam_id"`
	Name       string `json:"name" binding:"required"`
	SuperAdmin bool   `json:"super_admin"`
}

type ViolationSummary

type ViolationSummary struct {
	TotalWarns int64      `json:"total_warns"`
	TotalKicks int64      `json:"total_kicks"`
	TotalBans  int64      `json:"total_bans"`
	LastAction *time.Time `json:"last_action,omitempty"`
}

ViolationSummary represents a summary of player violations

type WarnPlayerRequest

type WarnPlayerRequest struct {
	SteamId string `json:"steam_id"`
	EosId   string `json:"eos_id"`
	Message string `json:"message" binding:"required"`
}

type WeaponStat

type WeaponStat struct {
	Weapon    string `json:"weapon"`
	Kills     int64  `json:"kills"`
	Teamkills int64  `json:"teamkills"`
}

WeaponStat represents weapon usage statistics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址