-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathanalysis_interface.go
More file actions
44 lines (35 loc) 路 829 Bytes
/
Copy pathanalysis_interface.go
File metadata and controls
44 lines (35 loc) 路 829 Bytes
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
package gorma
type AnalysisInterface interface {
Start(delimiters []string)
SaveReports(folder string) error
Close()
}
type Report struct {
Key string
Count uint64
Size uint64
NeverExpire uint64
AvgTtl uint64
}
type DBReports map[uint64][]Report
type KeyReports map[string]Report
type SortBySizeReports []Report
type SortByCountReports []Report
func (sr SortBySizeReports) Len() int {
return len(sr)
}
func (sr SortBySizeReports) Less(i, j int) bool {
return sr[i].Size > sr[j].Size
}
func (sr SortBySizeReports) Swap(i, j int) {
sr[i], sr[j] = sr[j], sr[i]
}
func (sr SortByCountReports) Len() int {
return len(sr)
}
func (sr SortByCountReports) Less(i, j int) bool {
return sr[i].Count > sr[j].Count
}
func (sr SortByCountReports) Swap(i, j int) {
sr[i], sr[j] = sr[j], sr[i]
}