Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupRoutes ¶
func SetupRoutes(r *gin.RouterGroup, cache SpotCache, dxccClient *dxcc.Client, lotwClient *lotw.Client)
SetupRoutes configures all API endpoints
Types ¶
type Cache ¶
Cache manages a thread-safe collection of DX spots with size limiting and timestamp ordering. If Redis is enabled, this acts as the "source of truth" after aggregation, and API queries will still filter this memory cache. For persistence + direct Redis query, we'd need a different strategy. For now, mirroring Node.js: in-memory is the primary API source, Redis for POTA dedupe.
func NewCache ¶
func NewCache() *Cache
NewCache creates a new empty spot cache with default max size.
func (*Cache) AddSpot ¶
AddSpot adds or updates a spot in the cache. If a spot with the same spotted callsign and frequency exists, it is updated (not duplicated). If cache exceeds max size, oldest spots are removed. Returns true if the spot was updated, false if it was added as new.
func (*Cache) GetAllSpots ¶
GetAllSpots returns all spots in the cache, sorted by timestamp (newest first).