Documentation
¶
Overview ¶
Package lua provides a wrapper around gopher-lua to easily enable Lua scripting support in Go applications. See New() for initialisation of Lua instance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lua ¶
type Lua struct {
// contains filtered or unexported fields
}
Lua is a wrapper around lua-state and provides functions for managing state and executing lua code.
func New ¶
New returns a new Lua instance initialised. Options can be provided to bind globals, register modules etc.
func (*Lua) Call ¶
Call a lua function by its name. Args are automatically converted to appropriate types using the Luar library
func (*Lua) Destroy ¶
func (l *Lua) Destroy()
Destroy releases all resources held by the lua state and marks the instance closed for usage.
func (*Lua) Execute ¶
Execute the given lua script string. Use Call() for calling a function for result.
func (*Lua) ExecuteFile ¶
ExecuteFile reads and executes the lua file. Use Call() for calling a function for result.
type Option ¶
Option can be provided to New() to customise initialization of Lua state.
func Globals ¶
Globals sets all values in the map as global variables in the lua state. See Module() to create a module from the map.