MCPcopy
hub / github.com/bettercap/bettercap / NewModuleHandler

Function NewModuleHandler

session/module_handler.go:32–46  ·  view source on GitHub ↗
(name string, expr string, desc string, exec func(args []string) error)

Source from the content-addressed store, hash-verified

30}
31
32func NewModuleHandler(name string, expr string, desc string, exec func(args []string) error) ModuleHandler {
33 h := ModuleHandler{
34 Mutex: &sync.Mutex{},
35 Name: name,
36 Description: desc,
37 Parser: nil,
38 exec: exec,
39 }
40
41 if expr != "" {
42 h.Parser = regexp.MustCompile(expr)
43 }
44
45 return h
46}
47
48func (h *ModuleHandler) Complete(name string, cb func(prefix string) []string) {
49 h.Completer = readline.PcItem(name, readline.PcItemDynamic(func(prefix string) []string {

Callers 15

NewTickerFunction · 0.92
NewDiscoveryFunction · 0.92
NewPacketProxyFunction · 0.92
NewEventsStreamFunction · 0.92
NewRestAPIFunction · 0.92
NewHttpsServerFunction · 0.92
NewMacChangerFunction · 0.92
NewCanModuleFunction · 0.92
NewAnyProxyFunction · 0.92
NewArpSpooferFunction · 0.92
NewMockNetReconFunction · 0.92
NewHIDReconFunction · 0.92

Calls

no outgoing calls

Tested by 4

NewMockNetReconFunction · 0.74
NewMockNetReconFunction · 0.74
NewMockNetReconFunction · 0.74
TestNewModuleHandlerFunction · 0.68