mirror of
https://github.com/MeshCore-Beacon/beacon-server.git
synced 2026-09-02 00:58:22 +00:00
changes channel storage to include the full key and a hashtag if isHashtag this prevents some collision issues and will improve message lookup accuracy as well as allow message search by hashtag channel, name or single byte hash in future
225 lines
9.5 KiB
Go
225 lines
9.5 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.31.1
|
|
|
|
package db
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
type Channel struct {
|
|
ID int32 `json:"id"`
|
|
ChannelHash []byte `json:"channel_hash"`
|
|
KeyFingerprint []byte `json:"key_fingerprint"`
|
|
Name *string `json:"name"`
|
|
Hashtag *string `json:"hashtag"`
|
|
IsHashtag *bool `json:"is_hashtag"`
|
|
IsPublic *bool `json:"is_public"`
|
|
KeyKnown *bool `json:"key_known"`
|
|
FirstSeen pgtype.Timestamptz `json:"first_seen"`
|
|
LastSeen pgtype.Timestamptz `json:"last_seen"`
|
|
MessageCount *int64 `json:"message_count"`
|
|
}
|
|
|
|
type ChannelKey struct {
|
|
ChannelID int32 `json:"channel_id"`
|
|
KeyBytes []byte `json:"key_bytes"`
|
|
KeyFingerprint []byte `json:"key_fingerprint"`
|
|
AddedAt pgtype.Timestamptz `json:"added_at"`
|
|
AddedBy *string `json:"added_by"`
|
|
}
|
|
|
|
type ChannelMessage struct {
|
|
ID int64 `json:"id"`
|
|
ChannelID int32 `json:"channel_id"`
|
|
PacketHash []byte `json:"packet_hash"`
|
|
SenderName *string `json:"sender_name"`
|
|
SenderPubkey []byte `json:"sender_pubkey"`
|
|
Content *string `json:"content"`
|
|
SentAt pgtype.Timestamptz `json:"sent_at"`
|
|
}
|
|
|
|
type IataCode struct {
|
|
Iata string `json:"iata"`
|
|
DisplayName *string `json:"display_name"`
|
|
ApproxLat *float64 `json:"approx_lat"`
|
|
ApproxLng *float64 `json:"approx_lng"`
|
|
AddedAt pgtype.Timestamptz `json:"added_at"`
|
|
}
|
|
|
|
type MvHourlyIataStat struct {
|
|
Iata string `json:"iata"`
|
|
Hour pgtype.Interval `json:"hour"`
|
|
ObservationCount int64 `json:"observation_count"`
|
|
UniquePackets int64 `json:"unique_packets"`
|
|
ActiveObservers int64 `json:"active_observers"`
|
|
}
|
|
|
|
type MvTopNodesByIatum struct {
|
|
Iata string `json:"iata"`
|
|
NodeID uuid.UUID `json:"node_id"`
|
|
Name *string `json:"name"`
|
|
NodeType int16 `json:"node_type"`
|
|
ObservationCount *int64 `json:"observation_count"`
|
|
LastHeard pgtype.Timestamptz `json:"last_heard"`
|
|
}
|
|
|
|
type Node struct {
|
|
ID uuid.UUID `json:"id"`
|
|
PublicKey []byte `json:"public_key"`
|
|
NodeType int16 `json:"node_type"`
|
|
Name *string `json:"name"`
|
|
Latitude *float64 `json:"latitude"`
|
|
Longitude *float64 `json:"longitude"`
|
|
LocationSource *string `json:"location_source"`
|
|
LastAdvertAt pgtype.Timestamptz `json:"last_advert_at"`
|
|
SupportsMultibytePaths bool `json:"supports_multibyte_paths"`
|
|
SupportsMultibyteTraces bool `json:"supports_multibyte_traces"`
|
|
MinFirmwareVersion *string `json:"min_firmware_version"`
|
|
FirstSeen pgtype.Timestamptz `json:"first_seen"`
|
|
LastSeen pgtype.Timestamptz `json:"last_seen"`
|
|
Metadata []byte `json:"metadata"`
|
|
}
|
|
|
|
type NodeIata struct {
|
|
NodeID uuid.UUID `json:"node_id"`
|
|
Iata string `json:"iata"`
|
|
FirstHeard pgtype.Timestamptz `json:"first_heard"`
|
|
LastHeard pgtype.Timestamptz `json:"last_heard"`
|
|
ObservationCount *int64 `json:"observation_count"`
|
|
}
|
|
|
|
type NodeShortID struct {
|
|
NodeID uuid.UUID `json:"node_id"`
|
|
Iata string `json:"iata"`
|
|
Prefix4 []byte `json:"prefix_4"`
|
|
Prefix1 []byte `json:"prefix_1"`
|
|
Prefix2 []byte `json:"prefix_2"`
|
|
Prefix3 []byte `json:"prefix_3"`
|
|
}
|
|
|
|
type Observer struct {
|
|
ID uuid.UUID `json:"id"`
|
|
PublicKey []byte `json:"public_key"`
|
|
DisplayName *string `json:"display_name"`
|
|
ObserverType *string `json:"observer_type"`
|
|
SoftwareVersion *string `json:"software_version"`
|
|
HardwareModel *string `json:"hardware_model"`
|
|
FirmwareVersion *string `json:"firmware_version"`
|
|
FirmwareBuild *string `json:"firmware_build"`
|
|
RadioFreqMhz *float32 `json:"radio_freq_mhz"`
|
|
RadioSf *int16 `json:"radio_sf"`
|
|
RadioBwKhz *float32 `json:"radio_bw_khz"`
|
|
RadioCr *int16 `json:"radio_cr"`
|
|
BatteryLevel *float32 `json:"battery_level"`
|
|
UptimeSeconds *int64 `json:"uptime_seconds"`
|
|
StatusMetadata []byte `json:"status_metadata"`
|
|
LastStatusAt pgtype.Timestamptz `json:"last_status_at"`
|
|
FirstSeen pgtype.Timestamptz `json:"first_seen"`
|
|
LastSeen pgtype.Timestamptz `json:"last_seen"`
|
|
ObservationCount *int64 `json:"observation_count"`
|
|
Metadata []byte `json:"metadata"`
|
|
}
|
|
|
|
type ObserverBroker struct {
|
|
ObserverID uuid.UUID `json:"observer_id"`
|
|
BrokerName string `json:"broker_name"`
|
|
FirstSeen pgtype.Timestamptz `json:"first_seen"`
|
|
LastSeen pgtype.Timestamptz `json:"last_seen"`
|
|
LastPacketAt pgtype.Timestamptz `json:"last_packet_at"`
|
|
AuthOk *bool `json:"auth_ok"`
|
|
}
|
|
|
|
type ObserverLocation struct {
|
|
ObserverID uuid.UUID `json:"observer_id"`
|
|
Iata *string `json:"iata"`
|
|
Latitude *float64 `json:"latitude"`
|
|
Longitude *float64 `json:"longitude"`
|
|
ReportedAt pgtype.Timestamptz `json:"reported_at"`
|
|
}
|
|
|
|
type ObserverOwner struct {
|
|
ObserverID uuid.UUID `json:"observer_id"`
|
|
OwnerNodeID pgtype.UUID `json:"owner_node_id"`
|
|
OwnerPubkey []byte `json:"owner_pubkey"`
|
|
ContactName *string `json:"contact_name"`
|
|
ContactEmail *string `json:"contact_email"`
|
|
Notes *string `json:"notes"`
|
|
Source *string `json:"source"`
|
|
AddedAt pgtype.Timestamptz `json:"added_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type ObserverTelemetry struct {
|
|
ID int64 `json:"id"`
|
|
ObserverID uuid.UUID `json:"observer_id"`
|
|
ReportedAt pgtype.Timestamptz `json:"reported_at"`
|
|
BatteryVoltageMv *int32 `json:"battery_voltage_mv"`
|
|
AirtimeTxPct *float32 `json:"airtime_tx_pct"`
|
|
AirtimeRxPct *float32 `json:"airtime_rx_pct"`
|
|
NoiseFloorDb *float32 `json:"noise_floor_db"`
|
|
UptimeSeconds *int64 `json:"uptime_seconds"`
|
|
QueueLength *int32 `json:"queue_length"`
|
|
DebugFlags *int32 `json:"debug_flags"`
|
|
ReceiveErrors *int32 `json:"receive_errors"`
|
|
}
|
|
|
|
type Packet struct {
|
|
PacketHash []byte `json:"packet_hash"`
|
|
PayloadType int16 `json:"payload_type"`
|
|
PayloadVersion int16 `json:"payload_version"`
|
|
RouteType int16 `json:"route_type"`
|
|
TransportCodesPresent *bool `json:"transport_codes_present"`
|
|
RegionCode *int32 `json:"region_code"`
|
|
SubRegionCode *int32 `json:"sub_region_code"`
|
|
OriginPubkey []byte `json:"origin_pubkey"`
|
|
RawPayload []byte `json:"raw_payload"`
|
|
ParsedPayload []byte `json:"parsed_payload"`
|
|
Decrypted *bool `json:"decrypted"`
|
|
ChannelHash []byte `json:"channel_hash"`
|
|
FirstHeardAt pgtype.Timestamptz `json:"first_heard_at"`
|
|
LastHeardAt pgtype.Timestamptz `json:"last_heard_at"`
|
|
ObservationCount *int32 `json:"observation_count"`
|
|
}
|
|
|
|
type PacketObservation struct {
|
|
ID int64 `json:"id"`
|
|
PacketHash []byte `json:"packet_hash"`
|
|
ObserverID uuid.UUID `json:"observer_id"`
|
|
Iata string `json:"iata"`
|
|
HeardAt pgtype.Timestamptz `json:"heard_at"`
|
|
PathLengthByte int16 `json:"path_length_byte"`
|
|
HashSize int16 `json:"hash_size"`
|
|
HopCount int16 `json:"hop_count"`
|
|
PathBytes []byte `json:"path_bytes"`
|
|
Rssi *int16 `json:"rssi"`
|
|
Snr *float32 `json:"snr"`
|
|
PropagationTimeMs *int32 `json:"propagation_time_ms"`
|
|
RadioFreqMhz *float32 `json:"radio_freq_mhz"`
|
|
SpreadFactor *int16 `json:"spread_factor"`
|
|
BandwidthKhz *float32 `json:"bandwidth_khz"`
|
|
CodingRate *int16 `json:"coding_rate"`
|
|
SourceBroker *string `json:"source_broker"`
|
|
}
|
|
|
|
type Region struct {
|
|
ID int32 `json:"id"`
|
|
Slug string `json:"slug"`
|
|
Name string `json:"name"`
|
|
Description *string `json:"description"`
|
|
DisplayOrder *int32 `json:"display_order"`
|
|
CenterLat *float64 `json:"center_lat"`
|
|
CenterLng *float64 `json:"center_lng"`
|
|
ZoomLevel *int32 `json:"zoom_level"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type RegionIata struct {
|
|
RegionID int32 `json:"region_id"`
|
|
Iata string `json:"iata"`
|
|
AddedAt pgtype.Timestamptz `json:"added_at"`
|
|
}
|