-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponse.go
79 lines (70 loc) · 2.93 KB
/
response.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package pskreporter
import (
"encoding/xml"
)
// query response is defined here: https://pskreporter.info/pskdev.html
// Response is the response format from the API.
type Response struct {
XMLName xml.Name `xml:"receptionReports"`
Text string `xml:",chardata"`
CurrentSeconds string `xml:"currentSeconds,attr"`
ActiveReceivers []ActiveReceiver `xml:"activeReceiver"`
LastSequenceNumber LastSequenceNumber `xml:"lastSequenceNumber"`
MaxFlowStartSeconds MaxFlowStartSeconds `xml:"maxFlowStartSeconds"`
ReceptionReports []ReceptionReport `xml:"receptionReport"`
SenderSearch SenderSearch `xml:"senderSearch"`
ActiveCallsigns []ActiveCallsign `xml:"activeCallsign"`
}
// ActiveCallsign represents an active call sign in the response.
type ActiveCallsign struct {
Text string `xml:",chardata"`
Callsign string `xml:"callsign,attr"`
Reports string `xml:"reports,attr"`
DXCC string `xml:"DXCC,attr"`
DXCCcode string `xml:"DXCCcode,attr"`
Frequency string `xml:"frequency,attr"`
}
// ActiveReceiver represents an active receiver in the response.
type ActiveReceiver struct {
Text string `xml:",chardata"`
Callsign string `xml:"callsign,attr"`
Locator string `xml:"locator,attr"`
Frequency string `xml:"frequency,attr"`
Region string `xml:"region,attr"`
DXCC string `xml:"DXCC,attr"`
DecoderSoftware string `xml:"decoderSoftware,attr"`
AntennaInformation string `xml:"antennaInformation,attr"`
Mode string `xml:"mode,attr"`
Bands string `xml:"bands,attr"`
}
// ReceptionReport represents a reception report in the response.
type ReceptionReport struct {
Text string `xml:",chardata"`
ReceiverCallsign string `xml:"receiverCallsign,attr"`
ReceiverLocator string `xml:"receiverLocator,attr"`
SenderCallsign string `xml:"senderCallsign,attr"`
SenderLocator string `xml:"senderLocator,attr"`
Frequency string `xml:"frequency,attr"`
FlowStartSeconds string `xml:"flowStartSeconds,attr"`
Mode string `xml:"mode,attr"`
IsSender string `xml:"isSender,attr"`
ReceiverDXCC string `xml:"receiverDXCC,attr"`
ReceiverDXCCCode string `xml:"receiverDXCCCode,attr"`
SNR string `xml:"sNR,attr"`
}
// SenderSearch represents the sender search in the response.
type SenderSearch struct {
Text string `xml:",chardata"`
Callsign string `xml:"callsign,attr"`
RecentFlowStartSeconds string `xml:"recentFlowStartSeconds,attr"`
}
// MaxFlowStartSeconds represents the max flow start seconds in the response.
type MaxFlowStartSeconds struct {
Text string `xml:",chardata"`
Value string `xml:"value,attr"`
}
// LastSequenceNumber is the last sequence number in the response.
type LastSequenceNumber struct {
Text string `xml:",chardata"`
Value string `xml:"value,attr"`
}