1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-16 11:37:36 +02:00
ferret/pkg/stdlib/strings/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

42 lines
1.3 KiB
Go

package strings
import "github.com/MontFerret/ferret/pkg/runtime/core"
func RegisterLib(ns core.Namespace) error {
return ns.RegisterFunctions(core.Functions{
"CONCAT": Concat,
"CONCAT_SEPARATOR": ConcatWithSeparator,
"CONTAINS": Contains,
"ESCAPE_HTML": EscapeHTML,
"DECODE_URI_COMPONENT": DecodeURIComponent,
"ENCODE_URI_COMPONENT": EncodeURIComponent,
"FIND_FIRST": FindFirst,
"FIND_LAST": FindLast,
"JSON_PARSE": JSONParse,
"JSON_STRINGIFY": JSONStringify,
"LEFT": Left,
"LIKE": Like,
"LOWER": Lower,
"LTRIM": LTrim,
"RANDOM_TOKEN": RandomToken,
"MD5": Md5,
"REGEXP_MATCH": RegexMatch,
"REGEXP_SPLIT": RegexSplit,
"REGEXP_TEST": RegexTest,
"REGEXP_REPLACE": RegexReplace,
"RIGHT": Right,
"RTRIM": RTrim,
"SHA1": Sha1,
"SHA512": Sha512,
"SPLIT": Split,
"SUBSTITUTE": Substitute,
"SUBSTRING": Substring,
"TO_BASE64": ToBase64,
"FROM_BASE64": FromBase64,
"TRIM": Trim,
"UPPER": Upper,
"FMT": Fmt,
"UNESCAPE_HTML": UnescapeHTML,
})
}