mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
new: net.show by seen command to sort by last seen date
This commit is contained in:
parent
b5ffab690d
commit
3a55b03ad0
2 changed files with 19 additions and 3 deletions
|
@ -9,3 +9,9 @@ type ByAddressSorter []*net.Endpoint
|
|||
func (a ByAddressSorter) Len() int { return len(a) }
|
||||
func (a ByAddressSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a ByAddressSorter) Less(i, j int) bool { return a[i].IpAddressUint32 < a[j].IpAddressUint32 }
|
||||
|
||||
type BySeenSorter []*net.Endpoint
|
||||
|
||||
func (a BySeenSorter) Len() int { return len(a) }
|
||||
func (a BySeenSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a BySeenSorter) Less(i, j int) bool { return a[i].LastSeen.Before(a[j].LastSeen) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue