Documentation
¶
Overview ¶
Package radioreference is a read-only client for RadioReference.com's SOAP web service, used by `gophertrunk hunt` to check whether a discovered trunked system already exists in RadioReference before an operator submits it. RadioReference has no public write API — new systems go through a manual web form reviewed by administrators — so this package never writes anything; it only reads, to avoid duplicate submissions.
Index ¶
Constants ¶
const DefaultEndpoint = "http://api.radioreference.com/soap2/"
DefaultEndpoint is the RadioReference SOAP web-service endpoint (v3.1).
Variables ¶
var ErrNoCredentials = errors.New("radioreference: no API key configured")
ErrNoCredentials is returned by NewClient when no API key is configured, so callers can cleanly skip the (optional) duplicate check.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
AppKey string
Username string
Password string
Version string // defaults to "latest"
}
Auth carries the RadioReference web-service credentials.
type Candidate ¶
Candidate is the discovered system's identifying fields, passed to MatchAgainst. It mirrors the parts of hunt.DiscoveredSystem relevant to duplicate detection without importing that package (avoiding a dependency cycle — the hunt CLI builds this from its DiscoveredSystem).
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a read-only RadioReference SOAP client. It is safe for sequential use; create one per hunt run.
func NewClient ¶
NewClient builds a client. It returns ErrNoCredentials when auth.AppKey is empty so the hunt can degrade gracefully to "no duplicate check".
func (*Client) GetCountyInfo ¶
GetCountyInfo fetches the trunked systems registered in a RadioReference county (by ctid). Only the brief identity of each system is returned; call GetTrsDetails to enrich a candidate with its SYSID/WACN before matching.
func (*Client) GetTrsDetails ¶
GetTrsDetails fetches a single trunked system by RadioReference system id. The response is parsed namespace-agnostically (the RR WSDL wraps the return in method-specific elements that vary by SOAP style), pulling the leaf fields used for duplicate detection.
func (*Client) SetEndpoint ¶
SetEndpoint overrides the SOAP endpoint (used by tests).
func (*Client) SetHTTPClient ¶
SetHTTPClient overrides the HTTP client (used by tests).
type Hint ¶
Hint is a possible duplicate match between a discovered system and an existing RadioReference system.
func MatchAgainst ¶
MatchAgainst compares a discovered system against a list of existing RadioReference systems and returns ranked duplicate hints. The strongest signal is a WACN+SYSID match (a P25 system's globally-unique identity); failing that, an overlapping control-channel frequency; failing that, an exact (case-insensitive) name match. Systems that match nothing are omitted.
type System ¶
type System struct {
SID int // RadioReference system id
Name string // system name (sName)
Type string // system type (sType), e.g. "Project 25 Phase II"
SystemID uint16 // decoded SYSID (0 when unknown)
WACN uint32 // decoded WACN (0 when unknown)
// ControlChannels are control-channel frequencies in Hz across the
// system's sites (best-effort; may be empty if not fetched).
ControlChannels []uint32
}
System is the subset of a RadioReference trunked-system record this package reads for duplicate detection.