Documentation
¶
Index ¶
- type Manager
- func (m *Manager) Close()
- func (m *Manager) CreatePersistent(code string, opts Options) (string, error)
- func (m *Manager) DestroyPersistent(id string)
- func (m *Manager) RegisterFunction(name string, fn lua.LGFunction)
- func (m *Manager) RunPersistent(id string) error
- func (m *Manager) RunVolatile(code string, opts Options) error
- func (m *Manager) SetDefaultSender(sender string)
- type Options
- type VMMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 persistent instances managed by this manager.
func (*Manager) CreatePersistent ¶ added in v0.12.2
CreatePersistent compiles the provided script once and returns an ID that can be rerun later.
func (*Manager) DestroyPersistent ¶ added in v0.12.2
DestroyPersistent removes the persistent VM identified by id.
func (*Manager) RegisterFunction ¶
func (m *Manager) RegisterFunction(name string, fn lua.LGFunction)
RegisterFunction exposes a Go function to all future Lua states managed by this manager.
func (*Manager) RunPersistent ¶ added in v0.12.2
RunPersistent executes the persistent VM associated with id.
func (*Manager) RunVolatile ¶ added in v0.12.2
RunVolatile creates a temporary VM, executes the script, and destroys it afterwards.
Source Files
¶
- manager.go
Click to show internal directories.
Click to hide internal directories.