Documentation ¶
Index ¶
- func AddLuaPath(p ...string)
- func ArrayToLuaTable(l *lua.LState, dic []interface{}) *lua.LTable
- func CheckGlobal(proto *lua.FunctionProto) error
- func CompileByString(name string, content string) (*lua.FunctionProto, error)
- func CompileByfile(filename string) (*lua.FunctionProto, error)
- func GetRealTypeAndValue(obj interface{}) (interface{}, reflect.Type)
- func SetLuaPath(p ...string)
- func SetReadOnly(l *lua.LState, table *lua.LTable) *lua.LUserData
- func StringArrayToLuaTable(l *lua.LState, dic []string) *lua.LTable
- func ToGoMap(lv lua.LValue) map[string]interface{}
- func ToGoStringArray(lv lua.LValue) []string
- func ToGoValue(lv lua.LValue, opt LuaOption) interface{}
- func ToLuaTable(l *lua.LState, dic map[string]string) *lua.LTable
- func ToLuaTable2(l *lua.LState, dic map[string]interface{}) *lua.LTable
- func ToLuaValue(v interface{}) lua.LValue
- func ToUpperCamelCase(s string) string
- type LuaContext
- type LuaHandle
- type LuaLib
- type LuaLogFunction
- type LuaOption
- type LuaPool
- type LuaScript
- func (this *LuaScript) Call(before LuaHandle, after LuaHandle) (interface{}, error)
- func (this *LuaScript) CallByParame(funcname string, p ...interface{}) (interface{}, error)
- func (this *LuaScript) Load(name, content string)
- func (this *LuaScript) Loadfile(filename string)
- func (this *LuaScript) SetPool(p *LuaPool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLuaPath ¶
func AddLuaPath(p ...string)
func CheckGlobal ¶
func CheckGlobal(proto *lua.FunctionProto) error
检查是否使用了全局变量 涉及到全局变量的指令有两条:GETGLOBAL(Opcode 5)和 SETGLOBAL(Opcode 7)
func CompileByString ¶
func CompileByString(name string, content string) (*lua.FunctionProto, error)
func CompileByfile ¶
func CompileByfile(filename string) (*lua.FunctionProto, error)
func GetRealTypeAndValue ¶
func SetLuaPath ¶
func SetLuaPath(p ...string)
func ToGoStringArray ¶
func ToLuaValue ¶
func ToUpperCamelCase ¶
ToUpperCamelCase is an Option.NameFunc that converts strings from snake case to upper camel case.
Types ¶
type LuaContext ¶
type LuaContext map[string]interface{}
type LuaLogFunction ¶
type LuaLogFunction func(string)
type LuaOption ¶
type LuaOption struct { // Function to convert a lua table key to Go's one. This defaults to "ToUpperCamelCase". NameFunc func(string) string // Returns error if unused keys exist. ErrorUnused bool // A struct tag name for lua table keys . This defaults to "gluamapper" TagName string }
Option is a configuration that is used to create a new mapper.
func NewLuaDefaultOption ¶
func NewLuaDefaultOption() LuaOption
func NewLuaOption ¶
func NewLuaOption() LuaOption
type LuaPool ¶
type LuaPool struct {
// contains filtered or unexported fields
}
lua虚拟机池
type LuaScript ¶
type LuaScript struct { Context LuaContext Log LuaLogFunction // contains filtered or unexported fields }
func (*LuaScript) CallByParame ¶
Click to show internal directories.
Click to hide internal directories.