gojs

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 13 Imported by: 2

README

gojs

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPluginsConfig added in v0.0.7

func LoadPluginsConfig(filename string)

func MakeAllPluginCode added in v0.0.4

func MakeAllPluginCode()

func MakeFromJsValue

func MakeFromJsValue(in quickjs.Value, ctx *plugin.Context) 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) (exportCode, interfaceCode 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 {
	Stack string
	// 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)

func RunPreCompiled added in v0.0.7

func RunPreCompiled(cc *PreCompiledCode, 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) ExecAtFile added in v0.0.7

func (rt *JSRuntime) ExecAtFile(code string, filename string) (jsErr *JSError)

func (*JSRuntime) ExecFile added in v0.0.4

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

func (*JSRuntime) ExecPreCompiled added in v0.0.7

func (rt *JSRuntime) ExecPreCompiled(cc *PreCompiledCode) (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) RunAtFile added in v0.0.7

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

func (*JSRuntime) RunFile added in v0.0.4

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

func (*JSRuntime) RunPreCompiled added in v0.0.7

func (rt *JSRuntime) RunPreCompiled(cc *PreCompiledCode) (out interface{}, jsErr *JSError)

type PreCompiledCode added in v0.0.7

type PreCompiledCode struct {
	FixedCode     string
	Plugins       []RequirePlugins
	Filename      string
	CodeLines     map[string][]string
	RealCodeLines map[string][]string
	Imports       map[string]string
	ImportedVar   map[string]string
}

func PreCompile added in v0.0.7

func PreCompile(code, filename string, logger *log.Logger) (*PreCompiledCode, error)

func PreCompileFile added in v0.0.7

func PreCompileFile(filename string, logger *log.Logger) (*PreCompiledCode, error)

type RequirePlugins added in v0.0.7

type RequirePlugins struct {
	Id      string
	Objects map[string]interface{}
	JsCode  string
}

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