add step list for server creation
All checks were successful
Release and Deploy / build (push) Successful in 9m5s
Release and Deploy / deploy (push) Successful in 26s

This commit is contained in:
Fran Jurmanović
2025-09-18 22:24:51 +02:00
parent 901dbe697e
commit 4004d83411
80 changed files with 950 additions and 2554 deletions

View File

@@ -4,7 +4,6 @@ import (
"github.com/google/uuid"
)
// ServerCreationStep represents the steps in server creation process
type ServerCreationStep string
const (
@@ -18,7 +17,6 @@ const (
StepCompleted ServerCreationStep = "completed"
)
// StepStatus represents the status of a step
type StepStatus string
const (
@@ -28,7 +26,6 @@ const (
StatusFailed StepStatus = "failed"
)
// WebSocketMessageType represents different types of WebSocket messages
type WebSocketMessageType string
const (
@@ -38,7 +35,6 @@ const (
MessageTypeComplete WebSocketMessageType = "complete"
)
// WebSocketMessage is the base structure for all WebSocket messages
type WebSocketMessage struct {
Type WebSocketMessageType `json:"type"`
ServerID *uuid.UUID `json:"server_id,omitempty"`
@@ -46,7 +42,6 @@ type WebSocketMessage struct {
Data interface{} `json:"data"`
}
// StepMessage represents a step update message
type StepMessage struct {
Step ServerCreationStep `json:"step"`
Status StepStatus `json:"status"`
@@ -54,26 +49,22 @@ type StepMessage struct {
Error string `json:"error,omitempty"`
}
// SteamOutputMessage represents SteamCMD output
type SteamOutputMessage struct {
Output string `json:"output"`
IsError bool `json:"is_error"`
}
// ErrorMessage represents an error message
type ErrorMessage struct {
Error string `json:"error"`
Details string `json:"details,omitempty"`
}
// CompleteMessage represents completion message
type CompleteMessage struct {
ServerID uuid.UUID `json:"server_id"`
Success bool `json:"success"`
Message string `json:"message"`
}
// GetStepDescription returns a human-readable description for each step
func GetStepDescription(step ServerCreationStep) string {
descriptions := map[ServerCreationStep]string{
StepValidation: "Validating server configuration",