Documentation ¶
Index ¶
- func Concat(_ context.Context, args ...core.Value) (core.Value, error)
- func ConcatWithSeparator(_ context.Context, args ...core.Value) (core.Value, error)
- func Contains(_ context.Context, args ...core.Value) (core.Value, error)
- func DecodeURIComponent(_ context.Context, args ...core.Value) (core.Value, error)
- func EncodeURIComponent(_ context.Context, args ...core.Value) (core.Value, error)
- func EscapeHTML(_ context.Context, args ...core.Value) (core.Value, error)
- func FindFirst(_ context.Context, args ...core.Value) (core.Value, error)
- func FindLast(_ context.Context, args ...core.Value) (core.Value, error)
- func Fmt(_ context.Context, args ...core.Value) (core.Value, error)
- func FromBase64(_ context.Context, args ...core.Value) (core.Value, error)
- func JSONParse(_ context.Context, args ...core.Value) (core.Value, error)
- func JSONStringify(_ context.Context, args ...core.Value) (core.Value, error)
- func LTrim(_ context.Context, args ...core.Value) (core.Value, error)
- func Left(_ context.Context, args ...core.Value) (core.Value, error)
- func Like(_ context.Context, args ...core.Value) (core.Value, error)
- func Lower(_ context.Context, args ...core.Value) (core.Value, error)
- func Md5(_ context.Context, args ...core.Value) (core.Value, error)
- func RTrim(_ context.Context, args ...core.Value) (core.Value, error)
- func RandomToken(_ context.Context, args ...core.Value) (core.Value, error)
- func RegexMatch(_ context.Context, args ...core.Value) (core.Value, error)
- func RegexReplace(_ context.Context, args ...core.Value) (core.Value, error)
- func RegexSplit(_ context.Context, args ...core.Value) (core.Value, error)
- func RegexTest(_ context.Context, args ...core.Value) (core.Value, error)
- func RegisterLib(ns core.Namespace) error
- func Right(_ context.Context, args ...core.Value) (core.Value, error)
- func Sha1(_ context.Context, args ...core.Value) (core.Value, error)
- func Sha512(_ context.Context, args ...core.Value) (core.Value, error)
- func Split(_ context.Context, args ...core.Value) (core.Value, error)
- func Substitute(_ context.Context, args ...core.Value) (core.Value, error)
- func Substring(_ context.Context, args ...core.Value) (core.Value, error)
- func ToBase64(_ context.Context, args ...core.Value) (core.Value, error)
- func Trim(_ context.Context, args ...core.Value) (core.Value, error)
- func UnescapeHTML(_ context.Context, args ...core.Value) (core.Value, error)
- func Upper(_ context.Context, args ...core.Value) (core.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Concat ¶
CONCAT concatenates one or more instances of String, or an Array. @param {String, repeated | String[]} src - The source string / array. @return {String} - A string value.
func ConcatWithSeparator ¶
CONCAT_SEPARATOR concatenates one or more instances of String, or an Array with a given separator. @param {String} separator - The separator string. @param {String, repeated | String[]} src - The source string / array. @return {String} - Concatenated string.
func Contains ¶
CONTAINS returns a value indicating whether a specified substring occurs within a string. @param {String} str - The source string. @param {String} search - The string to seek. @param {Boolean} [returnIndex=False] - Values which indicates whether to return the character position of the match is returned instead of a boolean. @return {Boolean | Int} - A value indicating whether a specified substring occurs within a string.
func DecodeURIComponent ¶ added in v0.8.0
DECODE_URI_COMPONENT returns the decoded String of uri. @param {String} uri - Uri to decode. @return {String} - Decoded string.
func EncodeURIComponent ¶
ENCODE_URI_COMPONENT returns the encoded String of uri. @param {String} uri - Uri to encode. @return {String} - Encoded string.
func EscapeHTML ¶ added in v0.8.0
ESCAPE_HTML escapes special characters like "<" to become "<". It escapes only five such characters: <, >, &, ' and ". UnescapeString(EscapeString(s)) == s always holds, but the converse isn't always true. @param {String} uri - Uri to escape. @return {String} - Escaped string.
func FindFirst ¶
FIND_FIRST returns the position of the first occurrence of the string search inside the string text. Positions start at 0. @param {String} str - The source string. @param {String} search - The string to seek. @param {Int} [start] - Limit the search to a subset of the text, beginning at start. @param {Int} [end] - Limit the search to a subset of the text, ending at end @return {Int} - The character position of the match. If search is not contained in text, -1 is returned. If search is empty, start is returned.
func FindLast ¶
FIND_LAST returns the position of the last occurrence of the string search inside the string text. Positions start at 0. @param {String} src - The source string. @param {String} search - The string to seek. @param {Int} [start] - Limit the search to a subset of the text, beginning at start. @param {Int} [end] - Limit the search to a subset of the text, ending at end @return {Int} - The character position of the match. If search is not contained in text, -1 is returned. If search is empty, start is returned.
func Fmt ¶ added in v0.5.0
FMT formats the template using these arguments. @param {String} template - template. @param {Any, repeated} args - template arguments. @return {String} - string formed by template using arguments.
func FromBase64 ¶ added in v0.3.0
FROM_BASE64 returns the value of a base64 representation. @param {String} str - The string to decode. @return {String} - The decoded string.
func JSONParse ¶
JSON_PARSE returns a value described by the JSON-encoded input string. @param {String} str - The string to parse as JSON. @return {Any} - Parsed value.
func JSONStringify ¶
JSON_STRINGIFY returns a JSON string representation of the input value. @param {Any} str - The input value to serialize. @return {String} - JSON string.
func LTrim ¶
LTRIM returns the string value with whitespace stripped from the start only. @param {String} str - The string. @param {String} chars - Overrides the characters that should be removed from the string. It defaults to \r\n \t. @return {String} - The string without chars at the left-hand side.
func Left ¶
LEFT returns the leftmost characters of the string value by index. @param {String} str - The source string. @param {Int} length - The amount of characters to return. @return {String} - The leftmost characters of the string value by index.
func Like ¶
LIKE checks whether the pattern search is contained in the string text, using wildcard matching. @param {String} str - The string to search in. @param {String} search - A search pattern that can contain the wildcard characters. @param {Boolean} caseInsensitive - If set to true, the matching will be case-insensitive. The default is false. @return {Boolean} - Returns true if the pattern is contained in text, and false otherwise.
func Lower ¶
LOWER converts strings to their lower-case counterparts. All other characters are returned unchanged. @param {String} str - The source string. @return {String} - THis string in lower case.
func Md5 ¶
MD5 calculates the MD5 checksum for text and return it in a hexadecimal string representation. @param {String} str - The string to do calculations against to. @return {String} - MD5 checksum as hex string.
func RTrim ¶
RTRIM returns the string value with whitespace stripped from the end only. @param {String} str - The string. @param {String} chars - Overrides the characters that should be removed from the string. It defaults to \r\n \t. @return {String} - The string without chars at the right-hand side.
func RandomToken ¶
RANDOM_TOKEN generates a pseudo-random token string with the specified length. The algorithm for token generation should be treated as opaque. @param {Int} len - The desired string length for the token. It must be greater than 0 and at most 65536. @return {String} - A generated token consisting of lowercase letters, uppercase letters and numbers.
func RegexMatch ¶
REGEX_MATCH returns the matches in the given string text, using the regex. @param {String} str - The string to search in. @param {String} expression - A regular expression to use for matching the text. @param {Boolean} caseInsensitive - If set to true, the matching will be case-insensitive. The default is false. @return {Any[]} - An array of strings containing the matches.
func RegexReplace ¶
REGEX_REPLACE replace every substring matched with the regexp with a given string. @param {String} str - The string to split. @param {String} expression - A regular expression search pattern. @param {String} replacement - The string to replace the search pattern with @param {Boolean} [caseInsensitive=False] - If set to true, the matching will be case-insensitive. @return {String} - Returns the string text with the search regex pattern replaced with the replacement string wherever the pattern exists in text
func RegexSplit ¶
REGEX_SPLIT splits the given string text into a list of strings, using the separator. @param {String} str - The string to split. @param {String} expression - A regular expression to use for splitting the text. @param {Boolean} caseInsensitive - If set to true, the matching will be case-insensitive. The default is false. @param {Int} limit - Limit the number of split values in the result. If no limit is given, the number of splits returned is not bounded. @return {Any[]} - An array of strings splitted by the expression.
func RegexTest ¶
REGEX_TEST test whether the regexp has at least one match in the given text. @param {String} str - The string to test. @param {String} expression - A regular expression to use for splitting the text. @param {Boolean} [caseInsensitive=False] - If set to true, the matching will be case-insensitive. @return {Boolean} - Returns true if the pattern is contained in text, and false otherwise.
func RegisterLib ¶ added in v0.8.0
func Right ¶
RIGHT returns the rightmost characters of the string value. @param {String} str - The source string. @param {Int} length - The amount of characters to return. @return {String} - The rightmost characters of the string value.
func Sha1 ¶
SHA1 calculates the SHA1 checksum for text and returns it in a hexadecimal string representation. @param {String} str - The string to do calculations against to. @return {String} - Sha1 checksum as hex string.
func Sha512 ¶
SHA512 calculates the SHA512 checksum for text and returns it in a hexadecimal string representation. @param {String} str - The string to do calculations against to. @return {String} - SHA512 checksum as hex string.
func Split ¶
SPLIT splits the given string value into a list of strings, using the separator. @param {String} str - The string to split. @param {String} separator - The separator. @param {Int} limit - Limit the number of split values in the result. If no limit is given, the number of splits returned is not bounded. @return {String[]} - Array of strings.
func Substitute ¶
SUBSTITUTE replaces search values in the string value. @param {String} str - The string to modify @param {String} search - The string representing a search pattern @param {String} replace - The string representing a replace value @param {Int} limit - The cap the number of replacements to this value. @return {String} - Returns a string with replace substring.
func Substring ¶
SUBSTRING returns a substring of value. @param {String} str - The source string. @param {Int} offset - Start at offset, offsets start at position 0. @param {Int} [length] - At most length characters, omit to get the substring from offset to the end of the string. @return {String} - A substring of value.
func ToBase64 ¶
TO_BASE64 returns the base64 representation of value. @param {String} str - The string to encode. @return {String} - A base64 representation of the string.
func Trim ¶
TRIM returns the string value with whitespace stripped from the start and/or end. @param {String} str - The string. @param {String} chars - Overrides the characters that should be removed from the string. It defaults to \r\n \t. @return {String} - The string without chars on both sides.
func UnescapeHTML ¶ added in v0.8.0
UNESCAPE_HTML unescapes entities like "<" to become "<". It unescapes a larger range of entities than EscapeString escapes. For example, "á" unescapes to "á", as does "á" and "á". UnescapeString(EscapeString(s)) == s always holds, but the converse isn't always true. @param {String} uri - Uri to escape. @return {String} - Escaped string.
Types ¶
This section is empty.