-
Notifications
You must be signed in to change notification settings - Fork 79
/
interface.go
57 lines (51 loc) · 1.26 KB
/
interface.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
package main
type Metadata struct {
NetWork string `json:"network"`
Type string `json:"type"`
SrcIP string `json:"sourceIP"`
DstIP string `json:"destinationIP"`
SrcPort string `json:"sourcePort"`
DstPort string `json:"destinationPort"`
AddrType int `json:"-"`
Host string `json:"host"`
}
func (m *Metadata) String() string {
if m.Host != "" {
return m.Host
} else if m.DstIP != "" {
return m.DstIP
} else {
return "<nil>"
}
}
type Basic struct {
ID string `json:"id"`
Type string `json:"type"`
}
type EventRuleMatch struct {
Basic
Duration int64 `json:"duration"`
Proxy string `json:"proxy"`
Rule string `json:"rule"`
Payload string `json:"payload"`
Error string `json:"error"`
Metadata Metadata `json:"metadata"`
}
type EventProxyDial struct {
Basic
Duration int64 `json:"duration"`
Proxy string `json:"proxy"`
Chain []string `json:"chain"`
Error string `json:"error"`
Address string `json:"address"`
Host string `json:"host"`
}
type EventDNSRequest struct {
Basic
Duration int64 `json:"duration"`
Name string `json:"name"`
Answer []string `json:"answer"`
Error string `json:"error"`
QType string `json:"qType"`
DNSType string `json:"dnsType"`
}