Debian Codegraph @

modules/hid/hid_show_sort.go

raw symbols SCIP
1 package hid
2
3 import (
4 "github.com/bettercap/bettercap/network"
5 )
6
7 type ByHIDMacSorter []*network.HIDDevice
8
9 func (a ByHIDMacSorter) Len() int { return len(a) }
10 func (a ByHIDMacSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
11 func (a ByHIDMacSorter) Less(i, j int) bool {
12 return a[i].Address < a[j].Address
13 }
14
15 type ByHIDSeenSorter []*network.HIDDevice
16
17 func (a ByHIDSeenSorter) Len() int { return len(a) }
18 func (a ByHIDSeenSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
19 func (a ByHIDSeenSorter) Less(i, j int) bool { return a[i].LastSeen.Before(a[j].LastSeen) }