new: preloading and exporting caplets from api.rest

This commit is contained in:
evilsocket 2019-03-19 19:10:40 +01:00
commit 3edf80fc99
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
3 changed files with 67 additions and 17 deletions

View file

@ -9,10 +9,19 @@ import (
)
type Caplet struct {
Name string
Path string
Size int64
Code []string
Name string `json:"name"`
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,
Path: path,
Size: size,
Code: make([]string, 0),
}
}
func (cap *Caplet) Eval(argv []string, lineCb func(line string) error) error {