From 7aecf2b6b95e7fd0cf34b274704b6f84ee935ab2 Mon Sep 17 00:00:00 2001 From: "Enot (ded) Skelly" Date: Fri, 5 Jun 2026 10:32:00 -0700 Subject: [PATCH] fix formatting allegedly --- db/nodes.go | 4 ++-- internal/api/nodes.go | 6 +++--- internal/api/packets.go | 24 ++++++++++++------------ internal/api/stats.go | 4 ++-- internal/config/config.go | 1 - 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/db/nodes.go b/db/nodes.go index 9c66b69..09569f9 100644 --- a/db/nodes.go +++ b/db/nodes.go @@ -103,7 +103,7 @@ func (s *Store) ListNodes(ctx context.Context, nodeType int16, iatas []string, s Latitude: v.Latitude, Longitude: v.Longitude, IsObserver: v.IsObserver, - ObserverID: nullableUUID(v.ObserverID), + ObserverID: nullableUUID(v.ObserverID), } if len(v.Iatas) > 0 { if err := json.Unmarshal(v.Iatas, &node.IATAs); err != nil { @@ -144,7 +144,7 @@ func (s *Store) GetNode(ctx context.Context, nodeID uuid.UUID) (*api.Node, error Latitude: row.Latitude, Longitude: row.Longitude, IsObserver: row.IsObserver, - ObserverID: nullableUUID(row.ObserverID), + ObserverID: nullableUUID(row.ObserverID), DefaultScope: row.DefaultScopeName, }, LocationSource: row.LocationSource, diff --git a/internal/api/nodes.go b/internal/api/nodes.go index b054c8c..02fa83b 100644 --- a/internal/api/nodes.go +++ b/internal/api/nodes.go @@ -16,12 +16,12 @@ type NodeIATA struct { // NodeSummary is the minimal node representation used in list responses. type NodeSummary struct { ID uuid.UUID `json:"id"` - PublicKey string `json:"publicKey"` // hex-encoded Ed25519 public key - NodeType int16 `json:"nodeType"` // 1=companion, 2=repeater, 3=room_server, 4=sensor + PublicKey string `json:"publicKey"` // hex-encoded Ed25519 public key + NodeType int16 `json:"nodeType"` // 1=companion, 2=repeater, 3=room_server, 4=sensor NodeTypeName string `json:"nodeTypeName"` Name *string `json:"name,omitempty"` IsObserver bool `json:"isObserver"` // true if this node is also a known observer - ObserverID *uuid.UUID `json:"observerId,omitempty"` // UUID of the associated observer row, if any + ObserverID *uuid.UUID `json:"observerId,omitempty"` // UUID of the associated observer row, if any Latitude *float64 `json:"lat,omitempty"` // decimal degrees, from advert AppData Longitude *float64 `json:"lng,omitempty"` // decimal degrees, from advert AppData Radio *string `json:"radio,omitempty"` // shorthand: "freqMhz,bwKhz,sf" e.g. "910.5,62.5,7" diff --git a/internal/api/packets.go b/internal/api/packets.go index 773a595..ae5b076 100644 --- a/internal/api/packets.go +++ b/internal/api/packets.go @@ -23,9 +23,9 @@ type PacketSummary struct { PayloadTypeName string `json:"payloadTypeName"` RouteType int16 `json:"routeType"` RouteTypeName string `json:"routeTypeName"` - Scope *string `json:"scope,omitempty"` // matched transport scope name e.g. "#bc" - FirstHeardAt int64 `json:"firstHeardAt"` // epoch ms - LastHeardAt int64 `json:"lastHeardAt"` // epoch ms + Scope *string `json:"scope,omitempty"` // matched transport scope name e.g. "#bc" + FirstHeardAt int64 `json:"firstHeardAt"` // epoch ms + LastHeardAt int64 `json:"lastHeardAt"` // epoch ms ObservationCount int32 `json:"observationCount"` LatestObserver *PacketLatestObserver `json:"latestObserver,omitempty"` Summary *string `json:"summary,omitempty"` // human-readable payload summary @@ -116,13 +116,13 @@ type Packet struct { TransportCodes *PacketTransportCodes `json:"transportCodes,omitempty"` OriginPubkey *string `json:"originPubkey,omitempty"` // hex-encoded; nil when not extractable from payload ParsedPayload json.RawMessage `json:"parsedPayload,omitempty"` - RawPayload string `json:"rawPayload"` // hex-encoded payload bytes (excludes header and path) - Decrypted bool `json:"decrypted"` // true if group text was successfully decrypted - ChannelHash *string `json:"channelHash,omitempty"` // hex-encoded single byte; non-nil for group_text/group_data - Scope *string `json:"scope,omitempty"` // matched transport scope name e.g. "#bc" - FirstHeardAt int64 `json:"firstHeardAt"` // epoch ms - LastHeardAt int64 `json:"lastHeardAt"` // epoch ms - FirstToLastMs int64 `json:"firstToLastMs"` // ms between first and last observation + RawPayload string `json:"rawPayload"` // hex-encoded payload bytes (excludes header and path) + Decrypted bool `json:"decrypted"` // true if group text was successfully decrypted + ChannelHash *string `json:"channelHash,omitempty"` // hex-encoded single byte; non-nil for group_text/group_data + Scope *string `json:"scope,omitempty"` // matched transport scope name e.g. "#bc" + FirstHeardAt int64 `json:"firstHeardAt"` // epoch ms + LastHeardAt int64 `json:"lastHeardAt"` // epoch ms + FirstToLastMs int64 `json:"firstToLastMs"` // ms between first and last observation ObservationCount int32 `json:"observationCount"` ResolvedRoute []ResolvedHop `json:"resolvedRoute,omitempty"` // trace packets only: resolved intended route Observations []PacketObservationDetail `json:"observations"` @@ -139,8 +139,8 @@ type AdvertObservation struct { // PacketObservationSummary is a lightweight packet+observation pair used in // list contexts such as observer adverts and node observations. type PacketObservationSummary struct { - ID int64 `json:"id"` // observation ID, use as cursor for pagination - PacketHash string `json:"packetHash"` // hex-encoded + ID int64 `json:"id"` // observation ID, use as cursor for pagination + PacketHash string `json:"packetHash"` // hex-encoded PayloadType int16 `json:"payloadType"` PayloadTypeName string `json:"payloadTypeName"` IATA string `json:"iata"` diff --git a/internal/api/stats.go b/internal/api/stats.go index 8d9b076..e7cd4dd 100644 --- a/internal/api/stats.go +++ b/internal/api/stats.go @@ -5,7 +5,7 @@ import "github.com/google/uuid" // RadioPreset represents a unique radio configuration observed in a given IATA, // aggregated from both observer status messages and node adverts. type RadioPreset struct { - Preset string `json:"preset"` // "freqMhz,bwKhz,sf" e.g. "910.525,62.5,7" + Preset string `json:"preset"` // "freqMhz,bwKhz,sf" e.g. "910.525,62.5,7" IATA string `json:"iata"` SourceType string `json:"sourceType"` // "observer" or "node" Count int64 `json:"count"` // number of observers or nodes on this preset in this IATA @@ -22,7 +22,7 @@ type StatsOverview struct { // ObservationPoint is a single time-bucketed observation count for charting. type ObservationPoint struct { - Hour int64 `json:"hour"` // epoch ms, start of the 1-hour bucket + Hour int64 `json:"hour"` // epoch ms, start of the 1-hour bucket IATA string `json:"iata"` ObservationCount int64 `json:"observationCount"` UniquePackets int64 `json:"uniquePackets"` diff --git a/internal/config/config.go b/internal/config/config.go index 89f2d3e..9223118 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -112,7 +112,6 @@ type RegionConfig struct { IATAs []string `yaml:"iatas"` } - // IngestFilterConfig restricts which packets Beacon stores based on the // observer's IATA geographic location. Both filters are optional — if neither // is set all IATAs are accepted. If both are set an IATA passes if it matches