This repository has been archived by the owner on Oct 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
137 lines (125 loc) · 3.81 KB
/
types.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
package wigole
import (
"io"
"net/url"
"time"
"github.com/MicahParks/wigole/api/network"
)
// Builder is the interface that creates the request URL and request body.
type Builder interface {
Body() (io.Reader, error)
Url() (values url.Values, err error)
}
// Detail is used to deserialize information returned from the WiGLE API. Used for inheritance.
type Detail struct {
Success bool
Cdma bool
Gsm bool
Lte bool
Wcdma bool
Wifi bool
Addresses []*network.GeocodingResponse
}
type failResp struct {
Success bool
Message string
}
// WiFiLocation is used to deserialize information returned from the WiGLE API. Used for inheritance.
// Look at "Models" at the bottom of https://api.wigle.net/swagger
type WiFiLocation struct {
Alt int
Accuracy float64
Lastupdt time.Time
Latitude float64
Longitude float64
Month string
Ssid string
Time time.Time
Signal int
Name string
NetId string
Noise float64
Snr float64
Wep string
Channel int
EncryptionValue string
}
// NetSearchResponse is used to deserialize information returned from the WiGLE API. Used for inheritance.
// Look at "Models" at the bottom of https://api.wigle.net/swagger
type NetSearchResponse struct {
Success bool
TotalResults int
First int
Last int
ResultCount int
Results []*WiFiNetworkWithLocation
SearchAfter string
SearchAfterDeprecated int `json:"search_after"`
}
// Network is used to deserialize information returned from the WiGLE API. Used for inheritance.
type Network struct {
Trilat float64
Trilong float64
Ssid string
Qos int
Transid string
Firsttime time.Time
Lasttime time.Time
Lastupdt time.Time
Netid string
Type string
Name string
Userfound bool
Country string
Region string
City string
Housenumber string
Road string
Postalcode string
}
// SearchParameters is used to deserialize information returned from the WiGLE API. Used for inheritance.
type SearchParameters struct {
Onlymine bool // Defaults to false.
Notmine bool
Latrange1 float64 // Makes Latrange2 used, even if 0.
Latrange2 float64 // Makes Latrange1 used, even if 0.
Longrange1 float64 // Makes Longrange2 used, even if 0.
Longrange2 float64 // Makes Longrange1 used, even if 0.
Lastupdt time.Time
StartTransID time.Time // Year level precision only.
EndTransID time.Time // Year level precision only.
MinQoS uint8 // Between 0-7.
Variance float64 // Between 0.001 and 0.2.
HouseNumber string
Road string
City string
Region string
PostalCode string
Country string
ResultsPerPage uint16 // Defaults to 25 for COMMAPI, 100 for site. Bounded at 1000 for COMMAPI, 100 for site.
SearchAfter string // What is this?
}
// SearchSsid is used to deserialize information returned from the WiGLE API. Used for inheritance.
type SearchSsid struct {
Ssid string // SSID exact match.
Ssidlike string // SSID with '%' as a wildcard and '_' as any character.
SearchParameters
}
// WiFiNetwork is used to deserialize information returned from the WiGLE API. Used for inheritance.
type WiFiNetwork struct {
Comment string
Wep string
Bcninterval int
Freenet string
Dhcp string
Paynet string
Channel int
Encryption string
Network
}
// WiFiNetworkWithLocation is used to deserialize information returned from the WiGLE API. Used for inheritance.
// Look at "Models" at the bottom of https://api.wigle.net/swagger
type WiFiNetworkWithLocation struct {
LocationData []*WiFiLocation
WiFiNetwork
}