golua

package
v0.0.0-...-a0a9f3d Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(state *lua.LState, fn lua.LValue, args ...any) error

func CallWithResult

func CallWithResult(state *lua.LState, fn lua.LValue, args ...any) (lua.LValue, error)

func CompileLuaFiles

func CompileLuaFiles(luaPath string)

func InitLuaPathAndCompile

func InitLuaPathAndCompile(luaPath string, compile bool)

func IsCompiled

func IsCompiled(luaName string) bool

IsCompiled 检查lua代码缓存是否存在

func IsLuaFunction

func IsLuaFunction(fn lua.LValue) bool

Types

type LuaEngine

type LuaEngine struct {
	L *lua.LState
}

func NewLuaEngine

func NewLuaEngine() *LuaEngine

func (*LuaEngine) Close

func (e *LuaEngine) Close()

func (*LuaEngine) DoLuaFile

func (e *LuaEngine) DoLuaFile(luaFile string) error

func (*LuaEngine) DoLuaMethod

func (e *LuaEngine) DoLuaMethod(luaFile string, method string, args ...any) error

DoLuaMethod call a func in luaFile

func (*LuaEngine) DoLuaMethodWithResult

func (e *LuaEngine) DoLuaMethodWithResult(luaFile string, method string, args ...any) (lua.LValue, error)

func (*LuaEngine) DoLuaString

func (e *LuaEngine) DoLuaString(luaCode string) error

func (*LuaEngine) LoadGopherLuaLibs

func (e *LuaEngine) LoadGopherLuaLibs()

LoadGopherLuaLibs gopher-lua-libs

func (*LuaEngine) LoadModule

func (e *LuaEngine) LoadModule(module string, loader func(L *lua.LState) int)

LoadModule 模块加载

Directories

Path Synopsis
module

Jump to

Keyboard shortcuts

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