From d5c9413f9e2090441f11915a7492dfb1d2c641ac Mon Sep 17 00:00:00 2001 From: blazSmehov Date: Thu, 11 Dec 2025 21:11:56 +0100 Subject: [PATCH] chore: clean unused types --- .gitignore | 4 ++- internal/pkg/model/types.go | 55 ------------------------------------- 2 files changed, 3 insertions(+), 56 deletions(-) diff --git a/.gitignore b/.gitignore index 2492246..1852e6d 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,6 @@ vendor/ volumes/node-red/ main -*.sh \ No newline at end of file +*.sh + +*.log \ No newline at end of file diff --git a/internal/pkg/model/types.go b/internal/pkg/model/types.go index a2edb37..e86882d 100644 --- a/internal/pkg/model/types.go +++ b/internal/pkg/model/types.go @@ -44,13 +44,6 @@ type BeaconAdvertisement struct { HSButtonMode string `json:"hb_button_mode"` } -// Advertisement describes a generic beacon advertisement payload. -type Advertisement struct { - Type string - Content string - Seen int64 -} - // BeaconMetric stores signal and distance data for a beacon. type BeaconMetric struct { Location string @@ -65,13 +58,6 @@ type Location struct { Lock sync.RWMutex } -// BestLocation represents the most probable location of a beacon. -type BestLocation struct { - Distance float64 - Name string - LastSeen int64 -} - // HTTPLocation describes a beacon's state as served over HTTP. type HTTPLocation struct { Method string `json:"method"` @@ -93,13 +79,6 @@ type LocationChange struct { Timestamp int64 `json:"timestamp"` } -// HAMessage represents a Home Assistant integration payload. -type HAMessage struct { - ID string `json:"id"` - BeaconName string `json:"name"` - Distance float64 `json:"distance"` -} - // Beacon holds all relevant information about a tracked beacon device. type Beacon struct { Name string `json:"name"` @@ -132,21 +111,6 @@ type BeaconEvent struct { Event int } -// Button represents a hardware button beacon device. -type Button struct { - Name string `json:"name"` - ButtonID string `json:"button_id"` - ButtonType string `json:"button_type"` - ButtonLocation string `json:"button_location"` - IncomingJSON BeaconAdvertisement `json:"incoming_json"` - Distance float64 `json:"distance"` - LastSeen int64 `json:"last_seen"` - HSButtonCounter int64 `json:"hs_button_counter"` - HSBattery int64 `json:"hs_button_battery"` - HSRandomNonce string `json:"hs_button_random"` - HSButtonMode string `json:"hs_button_mode"` -} - // BeaconsList holds all known beacons and their synchronization lock. type BeaconsList struct { Beacons map[string]Beacon `json:"beacons"` @@ -164,13 +128,6 @@ type LocationsList struct { Lock sync.RWMutex } -// Message defines the WebSocket or broadcast message payload. -type Message struct { - Email string `json:"email"` - Username string `json:"username"` - Message string `json:"message"` -} - // RawReading represents an incoming raw sensor reading. type RawReading struct { Timestamp string `json:"timestamp"` @@ -185,15 +142,6 @@ type LatestBeaconsList struct { Lock sync.RWMutex } -type HTTPLocationsList struct { - Beacons []HTTPLocation `json:"beacons"` -} - -type HTTPResultsList struct { - HTTPResultsLock sync.RWMutex - HTTPResults HTTPLocationsList -} - type ApiUpdate struct { Method string Beacon Beacon @@ -209,6 +157,3 @@ type KafkaWritersList struct { KafkaWritersLock sync.RWMutex KafkaWriters []*kafka.Writer } - -var HTTPHostPathPtr *string -var HTTPWSHostPathPtr *string