lua

package module
v0.0.0-...-b8e6d77 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-lua

基于GopherLua封装的一个Lua脚本引擎。

GopherLua是一个日本人使用纯Golang开发的Lua虚拟机,Lua的基本特性都实现得差不多了,也是够用了。

基本交互

变量

变量有三种访问方式:

  • 单向只写 - 将宿主的变量注入;
  • 单向只读 - 读取脚本中的变量;
  • 双向可读可写 - 将宿主的变量注入,脚本可操作宿主的变量并且反馈到宿主。
方法
  • 宿主调用脚本中的方法;
  • 脚本调用宿主中的方法。
模块

变量和方法都可以注册到全局,也可以注册到模块。模块是一个好的解决方案,以免全局栈上名字冲突。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRunPath

func GetRunPath() string

GetRunPath 获取程序执行目录

func NewVirtualMachine

func NewVirtualMachine() *virtualMachine

Types

type TableMap

type TableMap map[string]interface{}

Jump to

Keyboard shortcuts

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