add step list for server creation
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user