Documentation ¶
Overview ¶
Package luautil embeds Lua VM into Go
Index ¶
- func PullArbitraryValue(l *lua.State, remove bool) interface{}
- func PushTableFromMap(l *lua.State, v reflect.Value)
- func PushTableFromSlice(l *lua.State, v reflect.Value)
- func PushTableFromStruct(l *lua.State, v reflect.Value)
- func RunFile(ctx context.Context, filename string) (interface{}, bool)
- func RunInline(ctx context.Context, code string) (interface{}, bool)
- type LuaRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PullArbitraryValue ¶
func RunFile ¶
RunFile is similar to RunInline, except it takes in a filename which has the lua code to run. Note that the file's contents are cached, so the file is only opened and read the first time it's used.
func RunInline ¶
RunInline takes the given lua code, and runs it with the given ctx variable set as the lua global variable "ctx". The lua code is expected to return a boolean value, which is passed back as the first boolean return. The second boolean return will be false if there was an error and the code wasn't run
Types ¶
Click to show internal directories.
Click to hide internal directories.