Documentation
¶
Index ¶
- Variables
- type Config
- type Engine
- func (e *Engine) Close()
- func (e *Engine) ExecuteFunction(functionName string, args ...lua.LValue) ([]lua.LValue, error)
- func (e *Engine) ExecuteScript(scriptName string) error
- func (e *Engine) GetGlobal(name string) lua.LValue
- func (e *Engine) IsRestricted() bool
- func (e *Engine) LoadScript(scriptPath string) error
- func (e *Engine) LoadString(code string) error
- func (e *Engine) SetArgs(args []string)
- func (e *Engine) SetDebug(debug bool)
- func (e *Engine) SetGlobal(name string, value lua.LValue)
- type EngineConfig
- type LuaEngine
Constants ¶
This section is empty.
Variables ¶
var ( // Export module registration functions for packages that might use them directly RegisterNetworkModule = modules.RegisterNetworkModule RegisterHTTPModule = modules.RegisterHTTPModule RegisterCryptoModule = modules.RegisterCryptoModule RegisterSystemModule = modules.RegisterSystemModule RegisterFileModule = modules.RegisterFileModule RegisterTimeModule = modules.RegisterTimeModule RegisterUIModule = modules.RegisterUIModule RegisterJSONModule = modules.RegisterJSONModule )
Compatibility exports for backward compatibility
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
MaxExecutionTime time.Duration
MaxMemory int64
RestrictedMode bool
AllowedHosts []string
DeniedHosts []string
ModulesPath string
Debug bool
}
Config holds configuration for the Lua engine
type Engine ¶
Engine represents a Lua scripting engine for GoCat
func (*Engine) ExecuteFunction ¶
ExecuteFunction executes a specific function in the loaded script
func (*Engine) ExecuteScript ¶
ExecuteScript executes a loaded script's main function
func (*Engine) IsRestricted ¶
IsRestricted returns whether the engine is in restricted mode
func (*Engine) LoadScript ¶
LoadScript loads a Lua script from file
func (*Engine) LoadString ¶
LoadString loads and executes Lua code from a string
type EngineConfig ¶
type EngineConfig = Config
EngineConfig is a compatibility alias DEPRECATED: Use Config instead
type LuaEngine ¶
type LuaEngine struct {
*Engine
}
LuaEngine is a compatibility wrapper for the old API DEPRECATED: Use Engine instead
func NewLuaEngine ¶
func NewLuaEngine(config *EngineConfig) *LuaEngine
NewLuaEngine creates a new Lua engine (compatibility function) DEPRECATED: Use NewEngine instead
func (*LuaEngine) ExecuteScript ¶
ExecuteScript executes a loaded script's main function DEPRECATED: Use ExecuteFunction("main") instead
func (*LuaEngine) GetLuaState ¶
GetLuaState returns the underlying Lua state This is for advanced users who need direct access