luai

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginObjKey = "PLUGIN"
	OsType       = "OS_TYPE"
	ArchType     = "ARCH_TYPE"
	Runtime      = "RUNTIME"
)

Variables

This section is empty.

Functions

func ComputeUserAgent added in v1.0.0

func ComputeUserAgent(runtimeVersion, pluginName, pluginVersion string) string

ComputeUserAgent constructs a user agent string for the vfox runtime and plugin.

Parameters:

  • runtimeVersion: the version of the vfox runtime (may be empty).
  • pluginName: the name of the plugin (will be prefixed with "vfox-" if not already).
  • pluginVersion: the version of the plugin (may be empty).

Returns:

A user agent string in the format "vfox/<runtimeVersion> vfox-<pluginName>/<pluginVersion>",
omitting version information if not provided, and trimming extra spaces.

Types

type LuaVM

type LuaVM struct {
	Instance *lua.LState
}

func NewLuaVM

func NewLuaVM() *LuaVM

func (*LuaVM) CallFunction

func (vm *LuaVM) CallFunction(pluginObj *lua.LTable, funcName string, _args ...lua.LValue) (*lua.LTable, error)

func (*LuaVM) Close

func (vm *LuaVM) Close()

func (*LuaVM) LimitPackagePath

func (vm *LuaVM) LimitPackagePath(packagePaths ...string)

LimitPackagePath limits the package path of the Lua VM.

func (*LuaVM) Prepare

func (vm *LuaVM) Prepare(options *module.PreloadOptions) error

func (*LuaVM) ReturnedValue

func (vm *LuaVM) ReturnedValue() *lua.LTable

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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