From 6fcd2aaefb2ae44cd5071f5dd2b9b86806aac3ce Mon Sep 17 00:00:00 2001 From: rcourtman Date: Wed, 11 Feb 2026 10:02:39 +0000 Subject: [PATCH] refactor(dead-code): remove unused symbols in internal/servicediscovery --- internal/servicediscovery/commands.go | 16 ---------- internal/servicediscovery/fingerprint.go | 5 ---- internal/servicediscovery/service.go | 6 ---- internal/servicediscovery/types.go | 38 ++++++++++-------------- 4 files changed, 15 insertions(+), 50 deletions(-) diff --git a/internal/servicediscovery/commands.go b/internal/servicediscovery/commands.go index 2fe8f18d3..95fafeee5 100644 --- a/internal/servicediscovery/commands.go +++ b/internal/servicediscovery/commands.go @@ -43,12 +43,6 @@ type DiscoveryCommand struct { Optional bool `json:"optional"` // If true, don't fail if command fails } -// CommandSet represents a set of commands for a resource type. -type CommandSet struct { - ResourceType ResourceType - Commands []DiscoveryCommand -} - // GetCommandsForResource returns the commands to run for a given resource type. func GetCommandsForResource(resourceType ResourceType) []DiscoveryCommand { switch resourceType { @@ -551,13 +545,3 @@ func GetCommandCategories(resourceType ResourceType) []string { return categories } - -// GetCommandSummary returns a human-readable list of commands for a resource type. -func GetCommandSummary(resourceType ResourceType) []string { - commands := GetCommandsForResource(resourceType) - summaries := make([]string, 0, len(commands)) - for _, cmd := range commands { - summaries = append(summaries, cmd.Command) - } - return summaries -} diff --git a/internal/servicediscovery/fingerprint.go b/internal/servicediscovery/fingerprint.go index c4aa721d7..e30b50e2e 100644 --- a/internal/servicediscovery/fingerprint.go +++ b/internal/servicediscovery/fingerprint.go @@ -242,8 +242,3 @@ func GenerateK8sPodFingerprint(clusterID string, pod *KubernetesPod) *ContainerF return fp } - -// GenerateFingerprint is an alias for GenerateDockerFingerprint for backwards compatibility. -func GenerateFingerprint(hostID string, container *DockerContainer) *ContainerFingerprint { - return GenerateDockerFingerprint(hostID, container) -} diff --git a/internal/servicediscovery/service.go b/internal/servicediscovery/service.go index d7e1a4d73..b71c603cb 100644 --- a/internal/servicediscovery/service.go +++ b/internal/servicediscovery/service.go @@ -211,12 +211,6 @@ type AIAnalyzer interface { AnalyzeForDiscovery(ctx context.Context, prompt string) (string, error) } -// WSMessage represents a WebSocket message for broadcasting. -type WSMessage struct { - Type string `json:"type"` - Data interface{} `json:"data"` -} - // WSBroadcaster provides WebSocket broadcasting capabilities. type WSBroadcaster interface { BroadcastDiscoveryProgress(progress *DiscoveryProgress) diff --git a/internal/servicediscovery/types.go b/internal/servicediscovery/types.go index b282bf6ab..3c71323c9 100644 --- a/internal/servicediscovery/types.go +++ b/internal/servicediscovery/types.go @@ -26,11 +26,8 @@ type FactCategory string const ( FactCategoryVersion FactCategory = "version" - FactCategoryConfig FactCategory = "config" FactCategoryService FactCategory = "service" - FactCategoryPort FactCategory = "port" FactCategoryHardware FactCategory = "hardware" - FactCategoryNetwork FactCategory = "network" FactCategoryStorage FactCategory = "storage" FactCategoryDependency FactCategory = "dependency" FactCategorySecurity FactCategory = "security" @@ -40,21 +37,19 @@ const ( type ServiceCategory string const ( - CategoryDatabase ServiceCategory = "database" - CategoryWebServer ServiceCategory = "web_server" - CategoryCache ServiceCategory = "cache" - CategoryMessageQueue ServiceCategory = "message_queue" - CategoryMonitoring ServiceCategory = "monitoring" - CategoryBackup ServiceCategory = "backup" - CategoryNVR ServiceCategory = "nvr" - CategoryStorage ServiceCategory = "storage" - CategoryContainer ServiceCategory = "container" - CategoryVirtualizer ServiceCategory = "virtualizer" - CategoryNetwork ServiceCategory = "network" - CategorySecurity ServiceCategory = "security" - CategoryMedia ServiceCategory = "media" - CategoryHomeAuto ServiceCategory = "home_automation" - CategoryUnknown ServiceCategory = "unknown" + CategoryDatabase ServiceCategory = "database" + CategoryWebServer ServiceCategory = "web_server" + CategoryCache ServiceCategory = "cache" + CategoryMonitoring ServiceCategory = "monitoring" + CategoryBackup ServiceCategory = "backup" + CategoryNVR ServiceCategory = "nvr" + CategoryStorage ServiceCategory = "storage" + CategoryVirtualizer ServiceCategory = "virtualizer" + CategoryNetwork ServiceCategory = "network" + CategorySecurity ServiceCategory = "security" + CategoryMedia ServiceCategory = "media" + CategoryHomeAuto ServiceCategory = "home_automation" + CategoryUnknown ServiceCategory = "unknown" ) // ResourceDiscovery is the main data model for discovered resource information. @@ -176,11 +171,8 @@ type DiscoveryRequest struct { type DiscoveryStatus string const ( - DiscoveryStatusPending DiscoveryStatus = "pending" - DiscoveryStatusRunning DiscoveryStatus = "running" - DiscoveryStatusCompleted DiscoveryStatus = "completed" - DiscoveryStatusFailed DiscoveryStatus = "failed" - DiscoveryStatusNotStarted DiscoveryStatus = "not_started" + DiscoveryStatusRunning DiscoveryStatus = "running" + DiscoveryStatusCompleted DiscoveryStatus = "completed" ) // DiscoveryProgress represents the progress of an ongoing discovery.