From 2fd71c32dc6916cd64e26543ebec9fe1dfa627d4 Mon Sep 17 00:00:00 2001 From: Paul Payne Date: Tue, 14 Oct 2025 07:13:00 +0000 Subject: [PATCH] Formatting. --- go.mod | 3 +-- internal/assets/assets.go | 26 +++++++++++++------------- internal/config/config.go | 12 ++++++------ internal/dnsmasq/config.go | 10 +++++----- internal/tools/kubectl.go | 14 +++++++------- main.go | 6 +++--- 6 files changed, 35 insertions(+), 36 deletions(-) diff --git a/go.mod b/go.mod index 4ab0ca7..0cadc9f 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.24 require ( github.com/gorilla/mux v1.8.1 + github.com/rs/cors v1.11.1 gopkg.in/yaml.v3 v3.0.1 ) - -require github.com/rs/cors v1.11.1 // indirect diff --git a/internal/assets/assets.go b/internal/assets/assets.go index 2aa63e2..bb13b19 100644 --- a/internal/assets/assets.go +++ b/internal/assets/assets.go @@ -26,27 +26,27 @@ func NewManager(dataDir string) *Manager { // Asset represents a Talos boot asset type Asset struct { - Type string `json:"type"` // kernel, initramfs, iso - Path string `json:"path"` // Full path to asset file - Size int64 `json:"size"` // File size in bytes - SHA256 string `json:"sha256"` // SHA256 hash - Downloaded bool `json:"downloaded"` // Whether asset exists + Type string `json:"type"` // kernel, initramfs, iso + Path string `json:"path"` // Full path to asset file + Size int64 `json:"size"` // File size in bytes + SHA256 string `json:"sha256"` // SHA256 hash + Downloaded bool `json:"downloaded"` // Whether asset exists } // Schematic represents a Talos schematic and its assets type Schematic struct { - SchematicID string `json:"schematic_id"` - Version string `json:"version"` - Path string `json:"path"` - Assets []Asset `json:"assets"` + SchematicID string `json:"schematic_id"` + Version string `json:"version"` + Path string `json:"path"` + Assets []Asset `json:"assets"` } // AssetStatus represents download status for a schematic type AssetStatus struct { - SchematicID string `json:"schematic_id"` - Version string `json:"version"` - Assets map[string]Asset `json:"assets"` - Complete bool `json:"complete"` + SchematicID string `json:"schematic_id"` + Version string `json:"version"` + Assets map[string]Asset `json:"assets"` + Complete bool `json:"complete"` } // GetAssetDir returns the asset directory for a schematic diff --git a/internal/config/config.go b/internal/config/config.go index 6531128..8d4eb26 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -109,14 +109,14 @@ type InstanceConfig struct { IP string `yaml:"ip" json:"ip"` ExternalResolver string `yaml:"externalResolver" json:"externalResolver"` } `yaml:"dns" json:"dns"` - DHCPRange string `yaml:"dhcpRange" json:"dhcpRange"` - Dnsmasq struct { + DHCPRange string `yaml:"dhcpRange" json:"dhcpRange"` + Dnsmasq struct { Interface string `yaml:"interface" json:"interface"` } `yaml:"dnsmasq" json:"dnsmasq"` - BaseDomain string `yaml:"baseDomain" json:"baseDomain"` - Domain string `yaml:"domain" json:"domain"` - InternalDomain string `yaml:"internalDomain" json:"internalDomain"` - NFS struct { + BaseDomain string `yaml:"baseDomain" json:"baseDomain"` + Domain string `yaml:"domain" json:"domain"` + InternalDomain string `yaml:"internalDomain" json:"internalDomain"` + NFS struct { MediaPath string `yaml:"mediaPath" json:"mediaPath"` Host string `yaml:"host" json:"host"` StorageCapacity string `yaml:"storageCapacity" json:"storageCapacity"` diff --git a/internal/dnsmasq/config.go b/internal/dnsmasq/config.go index 302fc51..bbba520 100644 --- a/internal/dnsmasq/config.go +++ b/internal/dnsmasq/config.go @@ -89,11 +89,11 @@ func (g *ConfigGenerator) RestartService() error { // ServiceStatus represents the status of the dnsmasq service type ServiceStatus struct { - Status string `json:"status"` - PID int `json:"pid"` - ConfigFile string `json:"config_file"` - InstancesConfigured int `json:"instances_configured"` - LastRestart time.Time `json:"last_restart"` + Status string `json:"status"` + PID int `json:"pid"` + ConfigFile string `json:"config_file"` + InstancesConfigured int `json:"instances_configured"` + LastRestart time.Time `json:"last_restart"` } // GetStatus checks the status of the dnsmasq service diff --git a/internal/tools/kubectl.go b/internal/tools/kubectl.go index f02528a..5ed9da0 100644 --- a/internal/tools/kubectl.go +++ b/internal/tools/kubectl.go @@ -38,13 +38,13 @@ func (k *Kubectl) DeploymentExists(name, namespace string) bool { // PodInfo represents pod information from kubectl type PodInfo struct { - Name string - Status string - Ready string - Restarts int - Age string - Node string - IP string + Name string + Status string + Ready string + Restarts int + Age string + Node string + IP string } // DeploymentInfo represents deployment information diff --git a/main.go b/main.go index 96cbd90..674c71d 100644 --- a/main.go +++ b/main.go @@ -78,9 +78,9 @@ func main() { // Configure CORS // Default to development origins allowedOrigins := []string{ - "http://localhost:5173", // Vite dev server - "http://localhost:5174", // Alternative port - "http://localhost:3000", // Common React dev port + "http://localhost:5173", // Vite dev server + "http://localhost:5174", // Alternative port + "http://localhost:3000", // Common React dev port "http://127.0.0.1:5173", "http://127.0.0.1:5174", "http://127.0.0.1:3000",