-
Notifications
You must be signed in to change notification settings - Fork 0
/
target.go
50 lines (40 loc) · 1.03 KB
/
target.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
48
49
50
package main
type TargetType int
const (
MAC TargetType = iota + 1
SSID
)
type TargetItem struct {
Value string
TType TargetType
// This will store the 'value' when it is an SSID for display. The 'value' will now become a MAC
OriginalValue string
Ignored bool
Search bool
ChannelLocked bool
}
func (i TargetItem) Title() string {
if i.TType == MAC {
return "MAC: " + i.Value
}
if i.TType == SSID && i.OriginalValue != "" {
return "SSID: " + i.OriginalValue
}
return "SSID: " + i.Value
}
func (i TargetItem) Description() string { return "" }
func (i TargetItem) FilterValue() string { return i.Value }
// Check if the TargetItem is currently being ignored
func (t *TargetItem) IsIgnored() bool {
return t.Ignored
}
// Replace addToIgnoreList and removeFromIgnoreList with a single toggle function
func (t *TargetItem) ToggleIgnore() *TargetItem {
t.Ignored = !t.Ignored
return t
}
// // Enables search on the target Item
// func (t *TargetItem) EnableSearch() *TargetItem {
// t.Search = true
// return t
// }