forked from zmap/zgrab2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
module_set.go
30 lines (25 loc) · 881 Bytes
/
module_set.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
package zgrab2
// ModuleSet is a container holding named scan modules. It is a wrapper around a
// map.
type ModuleSet map[string]ScanModule
// AddModule adds m to the ModuleSet, accessible via the given name. If the name
// is already in the ModuleSet, it is overwritten.
func (s ModuleSet) AddModule(name string, m ScanModule) {
s[name] = m
}
// RemoveModule removes the module at the specified name. If the name is not in
// the module set, nothing happens.
func (s ModuleSet) RemoveModule(name string) {
delete(s, name)
}
// CopyInto copies the modules in s to destination. The sets will be unique, but
// the underlying ScanModule instances will be the same.
func (s ModuleSet) CopyInto(destination ModuleSet) {
for name, m := range s {
destination[name] = m
}
}
// NewModuleSet returns an empty ModuleSet.
func NewModuleSet() ModuleSet {
return make(ModuleSet)
}