Documentation ¶
Index ¶
- Constants
- type GoFunction
- type LuaError
- type LuaType
- type State
- func (s *State) AddPackagePath(path string) error
- func (s *State) Cleanup()
- func (s *State) Close()
- func (s *State) DoFile(filename string) error
- func (s *State) DoString(str string) error
- func (s *State) GetField(index int, key string)
- func (s *State) GetGlobal(name string)
- func (s *State) GetTable(index int)
- func (s *State) GetTableLength(index int) int
- func (s *State) GetTop() int
- func (s *State) GetType(index int) LuaType
- func (s *State) IsFunction(index int) bool
- func (s *State) IsTable(index int) bool
- func (s *State) NewTable()
- func (s *State) Pop(n int)
- func (s *State) PushBoolean(b bool)
- func (s *State) PushGoFunction(fn GoFunction) error
- func (s *State) PushNil()
- func (s *State) PushNumber(n float64)
- func (s *State) PushString(str string)
- func (s *State) PushTable(table map[string]interface{}) error
- func (s *State) PushValue(v interface{}) error
- func (s *State) RegisterGoFunction(name string, fn GoFunction) error
- func (s *State) Remove(index int)
- func (s *State) SetField(index int, key string)
- func (s *State) SetGlobal(name string)
- func (s *State) SetPackagePath(path string) error
- func (s *State) SetTable(index int)
- func (s *State) ToBoolean(index int) bool
- func (s *State) ToNumber(index int) float64
- func (s *State) ToString(index int) string
- func (s *State) ToTable(index int) (map[string]interface{}, error)
- func (s *State) ToValue(index int) (interface{}, error)
- func (s *State) UnregisterGoFunction(name string)
- type TableValue
Constants ¶
View Source
const ( LUA_MINSTACK = 20 // Minimum Lua stack size LUA_MAXSTACK = 1000000 // Maximum Lua stack size LUA_REGISTRYINDEX = -10000 // Pseudo-index for the Lua registry LUA_GLOBALSINDEX = -10002 // Pseudo-index for globals table )
Stack management constants from lua.h
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoFunction ¶
type State ¶
State represents a Lua state with configurable stack safety
func NewSafe ¶
func NewSafe() *State
NewSafe creates a new Lua state with full stack safety guarantees
func (*State) AddPackagePath ¶
func (*State) GetTableLength ¶
func (*State) IsFunction ¶
func (*State) NewTable ¶
func (s *State) NewTable()
NewTable creates a new table and pushes it onto the stack
func (*State) PushBoolean ¶
func (*State) PushGoFunction ¶
func (s *State) PushGoFunction(fn GoFunction) error
func (*State) PushNumber ¶
func (*State) PushString ¶
func (*State) PushTable ¶
PushTable pushes a Go map onto the Lua stack as a table with stack checking
func (*State) RegisterGoFunction ¶
func (s *State) RegisterGoFunction(name string, fn GoFunction) error
func (*State) SetField ¶
SetField sets a field in a table at the given index with cached absolute index
func (*State) SetPackagePath ¶
func (*State) UnregisterGoFunction ¶
Click to show internal directories.
Click to hide internal directories.