summaryrefslogtreecommitdiffstats
path: root/internal/formatter/bssid.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/formatter/bssid.go')
-rw-r--r--internal/formatter/bssid.go47
1 files changed, 47 insertions, 0 deletions
diff --git a/internal/formatter/bssid.go b/internal/formatter/bssid.go
new file mode 100644
index 0000000..06aa3cc
--- /dev/null
+++ b/internal/formatter/bssid.go
@@ -0,0 +1,47 @@
+package formatter
+
+import (
+ "fmt"
+
+ "git.db.org.ai/dborg/internal/models"
+ "git.db.org.ai/dborg/internal/utils"
+)
+
+func FormatBSSIDResults(response models.BSSIDLookupResponse, asJSON bool) error {
+ if asJSON {
+ return utils.PrintJSON(response)
+ }
+
+ if len(response) == 0 {
+ PrintWarning("No results found")
+ return nil
+ }
+
+ PrintSection("BSSID Lookup Results")
+
+ for i, result := range response {
+ if i > 0 {
+ PrintDivider()
+ }
+
+ fmt.Printf("\n%s: %s\n", Cyan("BSSID"), Bold(result.BSSID))
+
+ if result.Location != nil {
+ fmt.Printf("%s: %s\n", Cyan("Latitude"), Yellow(fmt.Sprintf("%.6f", result.Location.Latitude)))
+ fmt.Printf("%s: %s\n", Cyan("Longitude"), Yellow(fmt.Sprintf("%.6f", result.Location.Longitude)))
+ fmt.Printf("%s: %s\n", Cyan("Accuracy"), Dim(fmt.Sprintf("%d meters", result.Location.Accuracy)))
+
+ if result.GoogleMap != "" {
+ fmt.Printf("%s: %s\n", Cyan("Google Maps"), result.GoogleMap)
+ }
+ if result.OpenStreetMap != "" {
+ fmt.Printf("%s: %s\n", Cyan("OpenStreetMap"), result.OpenStreetMap)
+ }
+ } else {
+ fmt.Printf("%s\n", Gray("No location data available"))
+ }
+ }
+
+ fmt.Println()
+ return nil
+}