gojs

package module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 13 Imported by: 0

README

gojs

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeAllPluginCode added in v0.0.4

func MakeAllPluginCode()

func MakeFromJsValue

func MakeFromJsValue(in quickjs.Value) interface{}

func MakeJsValue

func MakeJsValue(ctx *plugin.Context, in interface{}, inArray bool) quickjs.Value

func MakeJsValueForPlugin

func MakeJsValueForPlugin(ctx *plugin.Context, in interface{}, pluginName string, inArray bool) quickjs.Value

func MakePluginCode added in v0.0.4

func MakePluginCode(plg *plugin.Plugin) string

func SetPluginsConfig added in v0.0.2

func SetPluginsConfig(conf map[string]plugin.Config)

Types

type ArgInfo added in v0.0.4

type ArgInfo struct {
	Name string
	Type string
	// contains filtered or unexported fields
}

func (*ArgInfo) String added in v0.0.4

func (argInfo *ArgInfo) String() string

type JSError added in v0.0.6

type JSError struct {
	// contains filtered or unexported fields
}

func Run

func Run(code string, option *RuntimeOption) (out interface{}, jsErr *JSError)

func RunAt added in v0.0.6

func RunAt(code, dir string, option *RuntimeOption) (out interface{}, jsErr *JSError)

func RunFile added in v0.0.4

func RunFile(filename string, option *RuntimeOption) (out interface{}, jsErr *JSError)

type JSRuntime added in v0.0.2

type JSRuntime struct {
	JsCtx *quickjs.Context
	GoCtx *plugin.Context
	// contains filtered or unexported fields
}

func New added in v0.0.2

func New(option *RuntimeOption) *JSRuntime

func (*JSRuntime) Close added in v0.0.2

func (rt *JSRuntime) Close()

func (*JSRuntime) Exec added in v0.0.2

func (rt *JSRuntime) Exec(code string) (jsErr *JSError)

func (*JSRuntime) ExecAt added in v0.0.6

func (rt *JSRuntime) ExecAt(code string, dir string) (jsErr *JSError)

func (*JSRuntime) ExecFile added in v0.0.4

func (rt *JSRuntime) ExecFile(filename string) (jsErr *JSError)

func (*JSRuntime) Import added in v0.0.6

func (rt *JSRuntime) Import(moduleName string) (varName string, searchList []string, jsErr *JSError)

func (*JSRuntime) Run added in v0.0.2

func (rt *JSRuntime) Run(code string) (out interface{}, jsErr *JSError)

func (*JSRuntime) RunAt added in v0.0.6

func (rt *JSRuntime) RunAt(code string, dir string) (out interface{}, jsErr *JSError)

func (*JSRuntime) RunFile added in v0.0.4

func (rt *JSRuntime) RunFile(filename string) (out interface{}, jsErr *JSError)

type RuntimeOption added in v0.0.4

type RuntimeOption struct {
	Globals map[string]interface{}
	Imports map[string]string
	Logger  *log.Logger
	DevMode bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL