Documentation ¶
Index ¶
- type Lua
- 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) CallFunc(lfn *lua.LFunction, args ...interface{}) (lua.LValue, error)
- func (wr *Wrapper) Execute(src string) error
- func (wr *Wrapper) ExecuteFile(fileName string) error
- func (wr *Wrapper) GetFunction(name string) (*lua.LFunction, 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 Lua ¶
type Lua struct {
// contains filtered or unexported fields
}
Lua implements skit.Handler using a lua scripting layer.
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper is a thin wrapper around gopher-lua defined lua state
func NewWrapper ¶
NewWrapper initializes a new wrapper with empty 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
func (*Wrapper) GetFunction ¶
GetFunction returns a function object defined in Lua if found.
Click to show internal directories.
Click to hide internal directories.