24 lines
436 B
Go
24 lines
436 B
Go
package httpx
|
|
|
|
import "github.com/d5/tengo/v2"
|
|
import "github.com/d5/tengo/v2/stdlib"
|
|
import "surdeus.su/util/tpp/paths"
|
|
|
|
var Modules = map[string]tengo.Importable{
|
|
"paths": paths.Module,
|
|
}
|
|
|
|
var Stdlib = stdlib.GetModuleMap(stdlib.AllModuleNames()...)
|
|
|
|
type ModuleGetter struct{}
|
|
|
|
func (m *ModuleGetter) Get(
|
|
name string,
|
|
) tengo.Importable {
|
|
module, exist := Modules[name]
|
|
if exist {
|
|
return module
|
|
}
|
|
|
|
return Stdlib.Get(name)
|
|
}
|