1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-16 11:37:36 +02:00
ferret/pkg/stdlib/lib.go
Tim Voronov 22382a0f61
Added namespace builder (#336)
* Added namespace builder

* Fixed linting issues

* Added extra check

* Updated e2e lib

* Renamed NamespaceBuilder to NamespaceContainer and changed func receivers

* Renamed NewLib to RegisterLib
2019-07-22 17:21:20 -04:00

46 lines
1011 B
Go

package stdlib
import (
"github.com/MontFerret/ferret/pkg/runtime/core"
"github.com/MontFerret/ferret/pkg/stdlib/arrays"
"github.com/MontFerret/ferret/pkg/stdlib/collections"
"github.com/MontFerret/ferret/pkg/stdlib/html"
"github.com/MontFerret/ferret/pkg/stdlib/math"
"github.com/MontFerret/ferret/pkg/stdlib/objects"
"github.com/MontFerret/ferret/pkg/stdlib/strings"
"github.com/MontFerret/ferret/pkg/stdlib/types"
"github.com/MontFerret/ferret/pkg/stdlib/utils"
)
func RegisterLib(ns core.Namespace) error {
if err := types.RegisterLib(ns); err != nil {
return err
}
if err := strings.RegisterLib(ns); err != nil {
return err
}
if err := math.RegisterLib(ns); err != nil {
return err
}
if err := collections.RegisterLib(ns); err != nil {
return err
}
if err := arrays.RegisterLib(ns); err != nil {
return err
}
if err := objects.RegisterLib(ns); err != nil {
return err
}
if err := html.RegisterLib(ns); err != nil {
return err
}
return utils.RegisterLib(ns)
}