mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
new: caplets will now include the list of sub scripts and files in api.rest
This commit is contained in:
parent
fe568c8188
commit
bf8a7659b5
2 changed files with 41 additions and 9 deletions
|
@ -8,22 +8,34 @@ import (
|
|||
"github.com/evilsocket/islazy/fs"
|
||||
)
|
||||
|
||||
type Caplet struct {
|
||||
Name string `json:"name"`
|
||||
type Script struct {
|
||||
Path string `json:"path"`
|
||||
Size int64 `json:"size"`
|
||||
Code []string `json:"code"`
|
||||
}
|
||||
|
||||
func NewCaplet(name string, path string, size int64) Caplet {
|
||||
return Caplet{
|
||||
Name: name,
|
||||
func newScript(path string, size int64) Script {
|
||||
return Script{
|
||||
Path: path,
|
||||
Size: size,
|
||||
Code: make([]string, 0),
|
||||
}
|
||||
}
|
||||
|
||||
type Caplet struct {
|
||||
Script
|
||||
Name string `json:"name"`
|
||||
Scripts []Script `json:"scripts"`
|
||||
}
|
||||
|
||||
func NewCaplet(name string, path string, size int64) Caplet {
|
||||
return Caplet{
|
||||
Script: newScript(path, size),
|
||||
Name: name,
|
||||
Scripts: make([]Script, 0),
|
||||
}
|
||||
}
|
||||
|
||||
func (cap *Caplet) Eval(argv []string, lineCb func(line string) error) error {
|
||||
if argv == nil {
|
||||
argv = []string{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue