-
Notifications
You must be signed in to change notification settings - Fork 360
/
repository.go
47 lines (40 loc) · 1.3 KB
/
repository.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
package hostname
// Repository for hostnames collection
type Repository interface {
CreateIndexes() error
Upsert(domainMap map[string]*Input)
}
//update ....
type update struct {
selector interface{}
query interface{}
}
//Input ....
type Input struct {
ResolvedIPs []string //Resolved IPs associated with a given hostname
ClientIPs []string //DNS Client IPs which issued queries for a given hostname
}
type hostname struct {
host string `bson:"host"`
ips []string `bson:"ips"`
clientIPs []string `bson:"client_ips"`
}
//ritaBLResult contains the summary of a result from the "ip" collection of rita-bl
type ritaBLResult struct {
index string `bson:"index"` // Potentially malicious IP
list string `bson:"list"` // which blacklist ip was listed on
}
//uconnRes (mystery: won't work if you change to lowercase, even though not exported ????)
type uconnRes struct {
Connections int `bson:"conn_count"`
UniqueConnections int `bson:"uconn_count"`
TotalBytes int `bson:"total_bytes"`
}
//AnalysisView (for reporting)
type AnalysisView struct {
Host string `bson:"host"`
Connections int `bson:"conn_count"`
UniqueConnections int `bson:"uconn_count"`
TotalBytes int `bson:"total_bytes"`
ConnectedHosts []string `bson:"ips,omitempty"`
}