config.go 306 B

1234567891011121314151617
  1. package extension
  2. import (
  3. lua "github.com/yuin/gopher-lua"
  4. )
  5. func GetConfigTable(em *ExtensionManager) *lua.LTable {
  6. config := em.L.NewTable()
  7. em.L.SetFuncs(config, map[string]lua.LGFunction{
  8. "set": func(L *lua.LState) int {
  9. em.M.DebugLog += "hi from lua"
  10. return 1
  11. },
  12. })
  13. return config
  14. }