cluster

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFrequency

func ParseFrequency(freqStr string) (int64, error)

parseFrequency converts a frequency string to int64 Hz. DX clusters typically send kHz, auto-detected by utils.ParseFrequency.

Types

type Client

type Client struct {

	// Channels for emitting events
	SpotChan    chan Spot
	MessageChan chan string
	ErrorChan   chan error // For parse errors or connection issues
	// contains filtered or unexported fields
}

Client represents a single DXCluster connection.

func NewClient

func NewClient(cfg config.ClusterConfig) (*Client, error)

NewClient creates and returns a new DXCluster client for a single connection.

func (*Client) Close

func (c *Client) Close()

Close gracefully closes the connection.

func (*Client) Connect

func (c *Client) Connect(ctx context.Context)

Connect establishes a connection to the DX cluster and starts the read loop. It also handles reconnection logic.

type Spot

type Spot struct {
	Spotter   string    `json:"spotter"`
	Spotted   string    `json:"spotted"`
	Frequency int64     `json:"frequency"` // In Hz (canonical storage unit)
	Message   string    `json:"message"`
	When      time.Time `json:"when"`
	Source    string    `json:"source"` // Name of the cluster it came from (e.g., "DXCluster", "SOTA")
}

Spot represents a parsed DX spot.

Jump to

Keyboard shortcuts

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