mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 09:37:02 +00:00
lua: Preload json module (#330)
Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/cjoudrey/gluahttp"
|
||||
"github.com/inbucket/gopher-json"
|
||||
lua "github.com/yuin/gopher-lua"
|
||||
)
|
||||
|
||||
@@ -28,6 +29,7 @@ func (lp *statePool) newState() (*lua.LState, error) {
|
||||
|
||||
// Load supplemental native modules.
|
||||
ls.PreloadModule("http", gluahttp.NewHttpModule(&http.Client{}).Loader)
|
||||
ls.PreloadModule("json", json.Loader)
|
||||
|
||||
// Setup channels.
|
||||
for name, ch := range lp.channels {
|
||||
|
||||
Reference in New Issue
Block a user