-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.go
76 lines (68 loc) · 2.19 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
package main
// AkamaiPayload is a Golang representation of the Cloudmonitor JSON datastructure
type AkamaiPayload struct {
// Content Provider ID
CP string `json:"cp"`
// Defines the format of the payload (?)
Format string `json:"format"`
ID string `json:"id"`
Start string `json:"start"`
Type string `json:"type"`
Version string `json:"version"`
Geo GeoStruct `json:"geo"`
Message MessageStruct `json:"message"`
NetPerf NetPerfStruct `json:"netPerf"`
Network NetworkStruct `json:"network"`
ReqHdr ReqHdrStruct `json:"reqHdr"`
RespHdr RespHdrStruct `json:"respHdr"`
}
// GeoStruct is used for storing the JSON subfields
type GeoStruct struct {
City string `json:"city"`
Country string `json:"country"`
Lat string `json:"lat"`
Long string `json:"long"`
Region string `json:"region"`
}
// MessageStruct is used for storing the JSON subfields
type MessageStruct struct {
UA string `json:"UA"`
Bytes string `json:"bytes"`
CliIP string `json:"cliIP"`
FwdHost string `json:"fwdHost"`
Proto string `json:"proto"`
ProtoVer string `json:"protoVer"`
ReqHost string `json:"reqHost"`
ReqMethod string `json:"reqMethod"`
ReqPath string `json:"reqPath"`
ReqPort string `json:"reqPort"`
RespCT string `json:"respCT"`
RespLen string `json:"respLen"`
Status string `json:"status"`
}
// NetPerfStruct is used for storing the JSON subfields
type NetPerfStruct struct {
Asnum string `json:"asnum"`
CacheStatus string `json:"cacheStatus"`
DownloadTime string `json:"downloadTime"`
EdgeIP string `json:"edgeIP"`
FirstByte string `json:"firstByte"`
LastByte string `json:"lastByte"`
LastMileRTT string `json:"lastMileRTT"`
}
// NetworkStruct is used for storing the JSON subfields
type NetworkStruct struct {
Asnum string `json:"asnum"`
EdgeIP string `json:"edgeIP"`
Network string `json:"network"`
NetworkType string `json:"networkType"`
}
// ReqHdrStruct is used for storing the JSON subfields
type ReqHdrStruct struct {
Cookie string `json:"cookie"`
}
// RespHdrStruct is used for storing the JSON subfields
type RespHdrStruct struct {
Server string `json:"server"`
ContEnc string `json:"contEnc"`
}