github.com/MontFerret/ferret@v0.18.0/pkg/stdlib/strings/lib.go (about)

     1  package strings
     2  
     3  import "github.com/MontFerret/ferret/pkg/runtime/core"
     4  
     5  func RegisterLib(ns core.Namespace) error {
     6  	return ns.RegisterFunctions(
     7  		core.NewFunctionsFromMap(map[string]core.Function{
     8  			"CONCAT":               Concat,
     9  			"CONCAT_SEPARATOR":     ConcatWithSeparator,
    10  			"CONTAINS":             Contains,
    11  			"ESCAPE_HTML":          EscapeHTML,
    12  			"DECODE_URI_COMPONENT": DecodeURIComponent,
    13  			"ENCODE_URI_COMPONENT": EncodeURIComponent,
    14  			"FIND_FIRST":           FindFirst,
    15  			"FIND_LAST":            FindLast,
    16  			"JSON_PARSE":           JSONParse,
    17  			"JSON_STRINGIFY":       JSONStringify,
    18  			"LEFT":                 Left,
    19  			"LIKE":                 Like,
    20  			"LOWER":                Lower,
    21  			"LTRIM":                LTrim,
    22  			"RANDOM_TOKEN":         RandomToken,
    23  			"MD5":                  Md5,
    24  			"REGEX_MATCH":          RegexMatch,
    25  			"REGEX_SPLIT":          RegexSplit,
    26  			"REGEX_TEST":           RegexTest,
    27  			"REGEX_REPLACE":        RegexReplace,
    28  			"RIGHT":                Right,
    29  			"RTRIM":                RTrim,
    30  			"SHA1":                 Sha1,
    31  			"SHA512":               Sha512,
    32  			"SPLIT":                Split,
    33  			"SUBSTITUTE":           Substitute,
    34  			"SUBSTRING":            Substring,
    35  			"TO_BASE64":            ToBase64,
    36  			"FROM_BASE64":          FromBase64,
    37  			"TRIM":                 Trim,
    38  			"UPPER":                Upper,
    39  			"FMT":                  Fmt,
    40  			"UNESCAPE_HTML":        UnescapeHTML,
    41  		}))
    42  }