-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodels.go
More file actions
378 lines (331 loc) · 11.2 KB
/
models.go
File metadata and controls
378 lines (331 loc) · 11.2 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
package bgpview
const URL = "https://api.bgpview.io/"
type Status struct {
Status string `json:"status"`
StatusMessage string `json:"status_message"`
Meta Meta `json:"@meta"`
}
type Meta struct {
TimeZone string `json:"time_zone"`
APIVersion int `json:"api_version"`
ExecutionTime string `json:"execution_time"`
}
// ASN
type ASN struct {
Data DataASN `json:"data"`
Status
}
type RirAllocation struct {
RirName string `json:"rir_name"`
CountryCode string `json:"country_code"`
DateAllocated string `json:"date_allocated"`
AllocationStatus string `json:"allocation_status"`
}
type IanaAssignment struct {
AssignmentStatus string `json:"assignment_status"`
Description string `json:"description"`
WhoisServer string `json:"whois_server"`
DateAssigned interface{} `json:"date_assigned"`
}
type DataASN struct {
Asn int `json:"asn"`
Name string `json:"name"`
DescriptionShort string `json:"description_short"`
DescriptionFull []string `json:"description_full"`
CountryCode string `json:"country_code"`
Website string `json:"website"`
EmailContacts []string `json:"email_contacts"`
AbuseContacts []string `json:"abuse_contacts"`
LookingGlass string `json:"looking_glass"`
TrafficEstimation string `json:"traffic_estimation"`
TrafficRatio string `json:"traffic_ratio"`
OwnerAddress []string `json:"owner_address"`
RirAllocation RirAllocation `json:"rir_allocation"`
IanaAssignment IanaAssignment `json:"iana_assignment"`
DateUpdated string `json:"date_updated"`
}
// ASNPrefixes
type ASNPrefixes struct {
Data DataASNPrefixes `json:"data"`
Status
}
type Parent struct {
Prefix string `json:"prefix"`
IP string `json:"ip"`
Cidr int `json:"cidr"`
RirName string `json:"rir_name"`
AllocationStatus string `json:"allocation_status"`
}
type Ipv4Prefixes struct {
Prefix string `json:"prefix"`
IP string `json:"ip"`
Cidr int `json:"cidr"`
RoaStatus string `json:"roa_status"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
Parent Parent `json:"parent"`
}
type Ipv6Prefixes struct {
Prefix string `json:"prefix"`
IP string `json:"ip"`
Cidr int `json:"cidr"`
RoaStatus string `json:"roa_status"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
Parent Parent `json:"parent"`
}
type DataASNPrefixes struct {
Ipv4Prefixes []Ipv4Prefixes `json:"ipv4_prefixes"`
Ipv6Prefixes []Ipv6Prefixes `json:"ipv6_prefixes"`
}
// ASNPeers
type ASNPeers struct {
Data DataASNPeers `json:"data"`
Status
}
type Ipv4Peers struct {
Asn int `json:"asn"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
}
type Ipv6Peers struct {
Asn int `json:"asn"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
}
type DataASNPeers struct {
Ipv4Peers []Ipv4Peers `json:"ipv4_peers"`
Ipv6Peers []Ipv6Peers `json:"ipv6_peers"`
}
// ASNUpstreams
type ASNUpstreams struct {
Data DataASNUpstreams `json:"data"`
Status
}
type Ipv4Upstreams struct {
Asn int `json:"asn"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
}
type Ipv6Upstreams struct {
Asn int `json:"asn"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
}
type DataASNUpstreams struct {
Ipv4Upstreams []Ipv4Upstreams `json:"ipv4_upstreams"`
Ipv6Upstreams []Ipv6Upstreams `json:"ipv6_upstreams"`
Ipv4Graph string `json:"ipv4_graph"`
Ipv6Graph string `json:"ipv6_graph"`
CombinedGraph string `json:"combined_graph"`
}
// ASNDownstreams
type ASNDownstreams struct {
Data DataASNDownstreams `json:"data"`
Status
}
type Ipv4Downstreams struct {
Asn int `json:"asn"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
}
type DataASNDownstreams struct {
Ipv4Downstreams []Ipv4Downstreams `json:"ipv4_downstreams"`
Ipv6Downstreams []interface{} `json:"ipv6_downstreams"`
}
// ASNIXs
type ASNIXs struct {
Data []DataASNIXs `json:"data"`
Status
}
type DataASNIXs struct {
IxID int `json:"ix_id"`
Name string `json:"name"`
NameFull string `json:"name_full"`
CountryCode string `json:"country_code"`
City string `json:"city"`
Ipv4Address string `json:"ipv4_address"`
Ipv6Address string `json:"ipv6_address"`
Speed int `json:"speed"`
}
// Prefix
type Prefix struct {
Data DataPrefix `json:"data"`
Status
}
type PrefixUpstreams struct {
Asn int `json:"asn"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
}
type Asns struct {
Asn int `json:"asn"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
PrefixUpstreams []PrefixUpstreams `json:"prefix_upstreams"`
}
type CountryCodes struct {
WhoisCountryCode string `json:"whois_country_code"`
RirAllocationCountryCode string `json:"rir_allocation_country_code"`
MaxmindCountryCode string `json:"maxmind_country_code"`
}
type RirAllocationPrefix struct {
RirName string `json:"rir_name"`
CountryCode string `json:"country_code"`
IP string `json:"ip"`
Cidr int `json:"cidr"`
Prefix string `json:"prefix"`
DateAllocated string `json:"date_allocated"`
AllocationStatus string `json:"allocation_status"`
}
type IanaAssignmentPrefix struct {
AssignmentStatus string `json:"assignment_status"`
Description string `json:"description"`
WhoisServer string `json:"whois_server"`
DateAssigned interface{} `json:"date_assigned"`
}
type Maxmind struct {
CountryCode string `json:"country_code"`
City string `json:"city"`
}
type DataPrefix struct {
Prefix string `json:"prefix"`
IP string `json:"ip"`
Cidr int `json:"cidr"`
Asns []Asns `json:"asns"`
Name string `json:"name"`
DescriptionShort string `json:"description_short"`
DescriptionFull []string `json:"description_full"`
EmailContacts []string `json:"email_contacts"`
AbuseContacts []string `json:"abuse_contacts"`
OwnerAddress []string `json:"owner_address"`
CountryCodes CountryCodes `json:"country_codes"`
RirAllocation RirAllocationPrefix `json:"rir_allocation"`
IanaAssignment IanaAssignmentPrefix `json:"iana_assignment"`
Maxmind Maxmind `json:"maxmind"`
RelatedPrefixes []interface{} `json:"related_prefixes"`
DateUpdated string `json:"date_updated"`
}
// IP
type IP struct {
Data DataIP `json:"data"`
Status
}
type Asn struct {
Asn int `json:"asn"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
}
type Prefixes struct {
Prefix string `json:"prefix"`
IP string `json:"ip"`
Cidr int `json:"cidr"`
Asn Asn `json:"asn"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
}
type RirAllocationIP struct {
RirName string `json:"rir_name"`
CountryCode string `json:"country_code"`
IP string `json:"ip"`
Cidr string `json:"cidr"`
Prefix string `json:"prefix"`
DateAllocated string `json:"date_allocated"`
AllocationStatus string `json:"allocation_status"`
}
type IanaAssignmentIP struct {
AssignmentStatus string `json:"assignment_status"`
Description string `json:"description"`
WhoisServer string `json:"whois_server"`
DateAssigned interface{} `json:"date_assigned"`
}
type MaxmindIP struct {
CountryCode string `json:"country_code"`
City interface{} `json:"city"`
}
type DataIP struct {
IP string `json:"ip"`
PtrRecord interface{} `json:"ptr_record"`
Prefixes []Prefixes `json:"prefixes"`
RirAllocation RirAllocationIP `json:"rir_allocation"`
IanaAssignment IanaAssignmentIP `json:"iana_assignment"`
Maxmind MaxmindIP `json:"maxmind"`
}
// IX
type IX struct {
Data DataIX `json:"data"`
Status
}
type DataIX struct {
Name string `json:"name"`
NameFull string `json:"name_full"`
Website string `json:"website"`
TechEmail interface{} `json:"tech_email"`
TechPhone interface{} `json:"tech_phone"`
PolicyEmail interface{} `json:"policy_email"`
PolicyPhone interface{} `json:"policy_phone"`
City string `json:"city"`
CountryCode string `json:"country_code"`
URLStats interface{} `json:"url_stats"`
MembersCount int `json:"members_count"`
Members []interface{} `json:"members"`
}
// Search
type Search struct {
Data DataSearch `json:"data"`
Status
}
type AsnsSearch struct {
Asn int `json:"asn"`
Name string `json:"name"`
Description string `json:"description"`
CountryCode string `json:"country_code"`
EmailContacts []string `json:"email_contacts"`
AbuseContacts []string `json:"abuse_contacts"`
RirName string `json:"rir_name"`
}
type Ipv4PrefixesSearch struct {
Prefix string `json:"prefix"`
IP string `json:"ip"`
Cidr int `json:"cidr"`
Name string `json:"name"`
CountryCode string `json:"country_code"`
Description string `json:"description"`
EmailContacts []string `json:"email_contacts"`
AbuseContacts []string `json:"abuse_contacts"`
RirName string `json:"rir_name"`
ParentPrefix string `json:"parent_prefix"`
ParentIP string `json:"parent_ip"`
ParentCidr int `json:"parent_cidr"`
}
type Ipv6PrefixesSearch struct {
Prefix string `json:"prefix"`
IP string `json:"ip"`
Cidr int `json:"cidr"`
Name string `json:"name"`
CountryCode string `json:"country_code"`
Description string `json:"description"`
EmailContacts []string `json:"email_contacts"`
AbuseContacts []string `json:"abuse_contacts"`
RirName string `json:"rir_name"`
ParentPrefix string `json:"parent_prefix"`
ParentIP string `json:"parent_ip"`
ParentCidr int `json:"parent_cidr"`
}
type DataSearch struct {
Asns []AsnsSearch `json:"asns"`
Ipv4Prefixes []Ipv4PrefixesSearch `json:"ipv4_prefixes"`
Ipv6Prefixes []Ipv6PrefixesSearch `json:"ipv6_prefixes"`
InternetExchanges []interface{} `json:"internet_exchanges"`
}