Documentation ¶
Overview ¶
Package core lists all the OPS in elsa Will be updated as an when new OPS are added
Index ¶
- Constants
- func CheckEnv(perms *options.Perms)
- func CheckFs(perms *options.Perms)
- func CheckNet(perms *options.Perms)
- func ConsoleLog(ctx *quickjs.Context, value []quickjs.Value) quickjs.Value
- func ElsaRecvNS(elsa *options.Elsa) ...
- func ElsaSendNS(elsa *options.Elsa) ...
- func Eval(text string, buffer *string) string
- func Marshal(jsonObj interface{}) ([]byte, error)
- func OpenPlugin(path string, arg interface{}) interface{}
- func PrepareRuntimeContext(cxt *quickjs.Context, jsruntime quickjs.Runtime, args []string, ...)
- func Repl()
- func Run(opt options.Options)
- type Formatter
Constants ¶
const ( FSWrite = 1 FSRead = 2 FSExists = 3 FSDirExists = 4 FSCwd = 5 Serve = 25 FSStat = 6 FSRemove = 7 FSMkdir = 9 FSWalk = 14 )
FileSystem ops
const (
Env = 11
)
env ops
const (
Fetch = 20
)
fetch ops
const (
Log = 10
)
console binding ops
const (
Plugin = 15
)
plugin ops
Variables ¶
This section is empty.
Functions ¶
func ConsoleLog ¶
ConsoleLog console.log bindings to quickjs engine
func ElsaRecvNS ¶
func ElsaRecvNS(elsa *options.Elsa) func(ctx *quickjs.Context, this quickjs.Value, args []quickjs.Value) quickjs.Value
ElsaRecvNS Native function corresponding to the JavaScript global `__recv` It is binded with `__recv` and accepts arguments including recv ID of the async function
func ElsaSendNS ¶
func ElsaSendNS(elsa *options.Elsa) func(ctx *quickjs.Context, this quickjs.Value, args []quickjs.Value) quickjs.Value
ElsaSendNS Native function corresponding to the JavaScript global `__send` It is binded with `__send` and accepts arguments including op ID
func OpenPlugin ¶
func OpenPlugin(path string, arg interface{}) interface{}
OpenPlugin open a dynamic lib and call the exported ElsaPlugin function with the args provided by the plugin op Currently, not compatible with windows
func PrepareRuntimeContext ¶
func PrepareRuntimeContext(cxt *quickjs.Context, jsruntime quickjs.Runtime, args []string, flags *options.Perms, mode string)
PrepareRuntimeContext prepare the runtime and context with Elsa's internal ops injects `__send` and `__recv` global dispatch functions into runtime