2019-10-19 21:17:34 +03:00
|
|
|
package io
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/MontFerret/ferret/pkg/runtime/core"
|
|
|
|
"github.com/MontFerret/ferret/pkg/stdlib/io/fs"
|
2020-02-21 11:06:45 -05:00
|
|
|
"github.com/MontFerret/ferret/pkg/stdlib/io/net"
|
2019-10-19 21:17:34 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// RegisterLib register `IO` namespace functions.
|
|
|
|
func RegisterLib(ns core.Namespace) error {
|
|
|
|
io := ns.Namespace("IO")
|
|
|
|
|
2020-02-21 11:06:45 -05:00
|
|
|
if err := fs.RegisterLib(io); err != nil {
|
2019-10-19 21:17:34 +03:00
|
|
|
return core.Error(err, "register `FS`")
|
|
|
|
}
|
|
|
|
|
2020-02-21 11:06:45 -05:00
|
|
|
if err := net.RegisterLib(io); err != nil {
|
|
|
|
return core.Error(err, "register `NET`")
|
|
|
|
}
|
|
|
|
|
2019-10-19 21:17:34 +03:00
|
|
|
return nil
|
|
|
|
}
|