spot

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BandFromName

func BandFromName(frequency float64) string

BandFromName converts a frequency to a ham radio band string. Accepts frequency in Hz, kHz, or MHz and automatically detects the unit. This function mirrors the qrg2band from the Node.js original.

Types

type Info

type Info struct {
	DXCC       *dxcc.DxccInfo     `json:"dxcc_info"`
	LoTW       *lotw.UserActivity `json:"lotw_info"`
	IsLoTWUser bool               `json:"lotw_user"` // Convenience field
}

Info represents the enriched DXCC and LoTW information for a callsign.

type Spot

type Spot struct {
	Spotter   string    `json:"spotter"`
	Spotted   string    `json:"spotted"`
	Frequency float64   `json:"frequency"` // In MHz
	Message   string    `json:"message"`
	When      time.Time `json:"when"`
	Source    string    `json:"source"` // e.g., "DXCluster", "SOTA", "pota"
	Band      string    `json:"band"`   // e.g., "20m", "40m"

	SpotterInfo Info `json:"spotter_data"`
	SpottedInfo Info `json:"spotted_data"`

	// Additional data for POTA, if applicable
	AdditionalData struct {
		PotaRef  string `json:"pota_ref,omitempty"`
		PotaMode string `json:"pota_mode,omitempty"`
	} `json:"additional_data,omitempty"`
}

Spot represents a single aggregated and enriched ham radio spot. This is the canonical struct used throughout the application and for API responses.

func (Spot) MarshalJSON

func (s Spot) MarshalJSON() ([]byte, error)

MarshalJSON customizes the JSON output to match the expected API format

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL