fix formatting

allegedly
This commit is contained in:
Enot (ded) Skelly
2026-06-05 10:32:00 -07:00
parent 9a1b1d27ee
commit 7aecf2b6b9
5 changed files with 19 additions and 20 deletions
+2 -2
View File
@@ -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,
+3 -3
View File
@@ -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"
+12 -12
View File
@@ -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"`
+2 -2
View File
@@ -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"`
-1
View File
@@ -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