Documentation
¶
Index ¶
- func InitCache()
- func InitPtrStore() (getPtrStore fnGetPtrStore, delPtrStore fnDelPtrStore)
- type LuaContext
- func (ctx *LuaContext) BindFunc(funcName string, funcVarPtr interface{}) (err error)
- func (ctx *LuaContext) BindFuncs(funcName2FuncVarPtr map[string]interface{}) (err error)
- func (ctx *LuaContext) CallFunc(funcName string, args ...interface{}) (res interface{}, err error)
- func (ctx *LuaContext) GetGlobal(name string) (res interface{}, err error)
- func (ctx *LuaContext) LoadFile(scriptFile string, env map[string]interface{}) (err error)
- func (ctx *LuaContext) LoadScript(script string, env map[string]interface{}) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitPtrStore ¶
func InitPtrStore() (getPtrStore fnGetPtrStore, delPtrStore fnDelPtrStore)
Types ¶
type LuaContext ¶
type LuaContext struct {
// contains filtered or unexported fields
}
func LoadFileFromCache ¶
func LoadFileFromCache(path string, vars map[string]interface{}) (ctx *LuaContext, existing bool, err error)
func NewContext ¶
func NewContext() (*LuaContext, error)
func (*LuaContext) BindFunc ¶
func (ctx *LuaContext) BindFunc(funcName string, funcVarPtr interface{}) (err error)
bind a var of golang func with a JS function name, so calling JS function is just calling the related golang func. @param funcVarPtr in format `var funcVar func(....) ...; funcVarPtr = &funcVar`
func (*LuaContext) BindFuncs ¶
func (ctx *LuaContext) BindFuncs(funcName2FuncVarPtr map[string]interface{}) (err error)
func (*LuaContext) CallFunc ¶
func (ctx *LuaContext) CallFunc(funcName string, args ...interface{}) (res interface{}, err error)
func (*LuaContext) GetGlobal ¶
func (ctx *LuaContext) GetGlobal(name string) (res interface{}, err error)
func (*LuaContext) LoadFile ¶
func (ctx *LuaContext) LoadFile(scriptFile string, env map[string]interface{}) (err error)
func (*LuaContext) LoadScript ¶
func (ctx *LuaContext) LoadScript(script string, env map[string]interface{}) (err error)
Click to show internal directories.
Click to hide internal directories.