mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-20 17:48:20 +00:00
Renamed collector, aggregator to api server, api folder to agent (#133)
* Renamed aggregator -> apiServer. * Format errors with container names. * Renamed collector -> apiServer. * Rephrased help messages. * Moved api -> agent. * Continue renameing api -> agent in Makefile and Dockerfiles.
This commit is contained in:
50
agent/pkg/utils/pathUtils.go
Normal file
50
agent/pkg/utils/pathUtils.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"github.com/djherbis/atime"
|
||||
"os"
|
||||
)
|
||||
|
||||
type ByModTime []os.FileInfo
|
||||
|
||||
func (fis ByModTime) Len() int {
|
||||
return len(fis)
|
||||
}
|
||||
|
||||
func (fis ByModTime) Swap(i, j int) {
|
||||
fis[i], fis[j] = fis[j], fis[i]
|
||||
}
|
||||
|
||||
func (fis ByModTime) Less(i, j int) bool {
|
||||
return fis[i].ModTime().Before(fis[j].ModTime())
|
||||
}
|
||||
|
||||
|
||||
type ByName []os.FileInfo
|
||||
|
||||
func (fis ByName) Len() int {
|
||||
return len(fis)
|
||||
}
|
||||
|
||||
func (fis ByName) Swap(i, j int) {
|
||||
fis[i], fis[j] = fis[j], fis[i]
|
||||
}
|
||||
|
||||
func (fis ByName) Less(i, j int) bool {
|
||||
return fis[i].Name() < fis[j].Name()
|
||||
}
|
||||
|
||||
|
||||
type ByCreationTime []os.FileInfo
|
||||
|
||||
func (fis ByCreationTime) Len() int {
|
||||
return len(fis)
|
||||
}
|
||||
|
||||
func (fis ByCreationTime) Swap(i, j int) {
|
||||
fis[i], fis[j] = fis[j], fis[i]
|
||||
}
|
||||
|
||||
func (fis ByCreationTime) Less(i, j int) bool {
|
||||
return atime.Get(fis[i]).Unix() < atime.Get(fis[j]).Unix()
|
||||
}
|
Reference in New Issue
Block a user