MCPcopy
hub / github.com/bettercap/bettercap / NewModuleParameter

Function NewModuleParameter

session/module_param.go:33–47  ·  view source on GitHub ↗
(name string, def_value string, t ParamType, validator string, desc string)

Source from the content-addressed store, hash-verified

31}
32
33func NewModuleParameter(name string, def_value string, t ParamType, validator string, desc string) *ModuleParam {
34 p := &ModuleParam{
35 Name: name,
36 Type: t,
37 Description: desc,
38 Value: def_value,
39 Validator: nil,
40 }
41
42 if validator != "" {
43 p.Validator = regexp.MustCompile(validator)
44 }
45
46 return p
47}
48
49func NewStringParameter(name string, def_value string, validator string, desc string) *ModuleParam {
50 return NewModuleParameter(name, def_value, STRING, validator, desc)

Callers 5

NewStringParameterFunction · 0.85
NewBoolParameterFunction · 0.85
NewIntParameterFunction · 0.85
NewDecimalParameterFunction · 0.85
TestNewModuleParameterFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestNewModuleParameterFunction · 0.68