Directories
¶
| Path | Synopsis |
|---|---|
|
basic is the README quickstart as a runnable program: embed the VM, expose a Go function, run a script, and read the results back.
|
basic is the README quickstart as a runnable program: embed the VM, expose a Go function, run a script, and read the results back. |
|
channel exposes a Go channel to Lua as userdata so two goroutines, each with its own LState, communicate by message passing.
|
channel exposes a Go channel to Lua as userdata so two goroutines, each with its own LState, communicate by message passing. |
|
channel-timeout shows the cancellable receive pattern: a Go callback that blocks on a channel reads L.Context() and selects on its Done() channel, so a SetContext deadline frees the goroutine instead of blocking forever.
|
channel-timeout shows the cancellable receive pattern: a Go callback that blocks on a channel reads L.Context() and selects on its Done() channel, so a SetContext deadline frees the goroutine instead of blocking forever. |
|
customlib registers host-provided modules so scripts can require() them: Requiref opens a module eagerly (and optionally as a global), Preload registers a lazy loader that runs on the first require.
|
customlib registers host-provided modules so scripts can require() them: Requiref opens a module eagerly (and optionally as a global), Preload registers a lazy loader that runs on the first require. |
|
debugger drives the in-process Debugger: set a breakpoint, run a script, and each time it stops inspect the frame and evaluate expressions in its scope, then resume.
|
debugger drives the in-process Debugger: set a breakpoint, run a script, and each time it stops inspect the frame and evaluate expressions in its scope, then resume. |
|
embed shows the data round-trip: build a table in Go and hand it to a script as a global, then convert Go values to Lua and back with ToValue/FromValue.
|
embed shows the data round-trip: build a table in Go and hand it to a script as a global, then convert Go values to Lua and back with ToValue/FromValue. |
|
openlib shows how to write your own library that installs like a built-in one.
|
openlib shows how to write your own library that installs like a built-in one. |
|
sandbox runs untrusted-ish code safely: a state with only safe libraries, a per-call _ENV that confines globals, and a deadline that stops a runaway loop.
|
sandbox runs untrusted-ish code safely: a state with only safe libraries, a per-call _ENV that confines globals, and a deadline that stops a runaway loop. |
|
userdata binds a Go type into Lua: register a named metatable, give it a method table, and hand scripts a userdatum they call methods on.
|
userdata binds a Go type into Lua: register a named metatable, give it a method table, and hand scripts a userdatum they call methods on. |
Click to show internal directories.
Click to hide internal directories.