Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
Instance represents a single Lua VM.
func (*Instance) Close ¶
func (i *Instance) Close()
Close shuts down the Lua state and unregisters it from the manager.
func (*Instance) RunFile ¶
RunFile executes a Lua script file.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager coordinates multiple sandboxed Lua states.
func NewManager ¶
NewManager creates a manager with an optional logger. When logger is nil, scripting logs are dropped.
func (*Manager) Close ¶
func (m *Manager) Close()
Close stops all instances managed by this manager.
func (*Manager) NewInstance ¶
NewInstance creates a new Lua state with a sandboxed environment.
func (*Manager) RegisterFunction ¶
func (m *Manager) RegisterFunction(name string, fn lua.LGFunction)
RegisterFunction exposes a Go function to all Lua states managed by this manager.
Source Files
¶
- manager.go
Click to show internal directories.
Click to hide internal directories.