Documentation ¶
Overview ¶
Package embedlua provides a simple convinience wrapper around `github.com/yuin/gopher-lua` package for embedding lua scripting backend
Index ¶
- type Wrapper
- func (wr *Wrapper) Bind(name string, v interface{})
- func (wr *Wrapper) BindAll(vals map[string]interface{})
- func (wr *Wrapper) Call(name string, args ...interface{}) (lua.LValue, error)
- func (wr *Wrapper) Execute(src string) error
- func (wr *Wrapper) ExecuteFile(fileName string) error
- func (wr *Wrapper) Reset()
- func (wr *Wrapper) State() *lua.LState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper is a thin wrapper around gopher-lua defined lua state
func (*Wrapper) Bind ¶
Bind creates a global variable with given value and name thus exposing the value to the lua script
func (*Wrapper) BindAll ¶
BindAll exposes all the values in the map to the lua scripts by iteratively calling Bind with key and value
func (*Wrapper) Call ¶
Call a lua function by its name. Args are automatically converted to appropriate types using the Luar library
func (*Wrapper) ExecuteFile ¶
ExecuteFile reads and executes the lua file
Click to show internal directories.
Click to hide internal directories.