modules.go 859 B

123456789101112131415161718192021222324
  1. package xmodules
  2. import "github.com/d5/tengo/v2/stdlib"
  3. import "surdeus.su/core/xgo/xmodules/cjson"
  4. import "surdeus.su/core/xgo/xmodules/logx"
  5. import "surdeus.su/core/xgo/xmodules/paths"
  6. import "surdeus.su/core/xgo/xmodules/httpx"
  7. import "surdeus.su/core/xgo/xmodules/htmlx"
  8. import "surdeus.su/core/xgo/xmodules/objects"
  9. import "surdeus.su/core/xgo/xmodules/enumx"
  10. import "github.com/d5/tengo/v2"
  11. // The main map to import all the implemented modules.
  12. func GetModules() *tengo.ModuleMap {
  13. ret := stdlib.GetModuleMap(stdlib.AllModuleNames()...)
  14. ret.AddBuiltinModule("cjson", cjson.Module)
  15. ret.AddBuiltinModule("log", logx.Module)
  16. ret.AddBuiltinModule("paths", paths.Module)
  17. ret.AddBuiltinModule("http", httpx.Module)
  18. ret.AddBuiltinModule("html", htmlx.Module)
  19. ret.Add("objects", objects.GetModule())
  20. ret.Add("enumx", enumx.GetModule())
  21. return ret
  22. }