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 EncodeURIComponent(_ 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 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 NewLib() map[string]core.Function
- 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 Reverse(_ context.Context, args ...core.Value) (core.Value, 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 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 Read, or an Array. @params src (String...|Array) - The source string / array. @returns String
func ConcatWithSeparator ¶
ConcatWithSeparator concatenates one or more instances of Read, or an Array with a given separator. @params separator (string) - The separator string. @params src (string...|array) - The source string / array. @returns string
func Contains ¶
Contains returns a value indicating whether a specified substring occurs within a string. @param src (String) - The source string. @param search (String) - The string to seek. @param returnIndex (Boolean) - Values which indicates whether to return the character position of the match is returned instead of a boolean. The default is false. @returns (Boolean|Int)
func EncodeURIComponent ¶
EncodeURIComponent returns the encoded String of uri. @param (String) - Uri to encode. @returns String - Encoded string.
func FindFirst ¶
FindFirst returns the position of the first occurrence of the string search inside the string text. Positions start at 0. @param src (String) - The source string. @param search (String) - The string to seek. @param start (Int, optional) - Limit the search to a subset of the text, beginning at start. @param end (Int, optional) - Limit the search to a subset of the text, ending at end @returns (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 ¶
FindLast returns the position of the last occurrence of the string search inside the string text. Positions start at 0. @param src (String) - The source string. @param search (String) - The string to seek. @param start (Int, optional) - Limit the search to a subset of the text, beginning at start. @param end (Int, optional) - Limit the search to a subset of the text, ending at end @returns (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 FromBase64 ¶ added in v0.3.0
* Returns the value of a base64 representation. * @param base64String (String) - The string to decode. * @returns value (String) - The decoded string.
func JSONParse ¶
JSONParse returns a FQL value described by the JSON-encoded input string. @params text (String) - The string to parse as JSON. @returns FQL value (Read)
func JSONStringify ¶
JSONStringify returns a JSON string representation of the input value. @params value (Read) - The input value to serialize. @returns json (String)
func LTrim ¶
LTrim returns the string value with whitespace stripped from the start only. @param value (String) - The string. @param chars (String) - Overrides the characters that should be removed from the string. It defaults to \r\n \t. @returns (String) - The string without chars at the left-hand side.
func Left ¶
Left returns the leftmost characters of the string value by index. @param src (String) - The source string. @params length (Int) - The amount of characters to return. @returns substr (String)
func Like ¶
Like checks whether the pattern search is contained in the string text, using wildcard matching. @param text (String) - The string to search in. @param search (String) - A search pattern that can contain the wildcard characters. @param caseInsensitive (Boolean) - 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 src (String) - The source string. @returns (String) - THis string in lower case.
func Md5 ¶
Md5 calculates the MD5 checksum for text and return it in a hexadecimal string representation. @param text (String) - 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 value (String) - The string. @param chars (String) - Overrides the characters that should be removed from the string. It defaults to \r\n \t. @returns (String) - The string without chars at the right-hand side.
func RandomToken ¶
RandomToken generates a pseudo-random token string with the specified length. The algorithm for token generation should be treated as opaque. @param length (Int) - 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 ¶
RegexMatch returns the matches in the given string text, using the regex. @param text (String) - The string to search in. @param regex (String) - A regular expression to use for matching the text. @param caseInsensitive (Boolean) - If set to true, the matching will be case-insensitive. The default is false. @return (Array) - An array of strings containing the matches.
func RegexReplace ¶
RegexReplace replace every substring matched with the regexp with a given string. @param text (String) - The string to split. @param regex (String) - A regular expression search pattern. @param replacement (String) - The string to replace the search pattern with @param caseInsensitive (Boolean) - If set to true, the matching will be case-insensitive. The default is false. @return (String) - Returns the string text with the search regex pattern replaced with the replacement string wherever the pattern exists in text
func RegexSplit ¶
RegexSplit splits the given string text into a list of strings, using the separator. @param text (String) - The string to split. @param regex (String) - A regular expression to use for splitting the text. @param caseInsensitive (Boolean) - If set to true, the matching will be case-insensitive. The default is false. @param limit (Int) - Limit the number of split values in the result. If no limit is given, the number of splits returned is not bounded. @return (Array) - An array of strings splited by teh expression.
func RegexTest ¶
RegexTest test wether the regexp has at least one match in the given text. @param text (String) - The string to split. @param regex (String) - A regular expression to use for splitting the text. @param caseInsensitive (Boolean) - 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 Reverse ¶
Reverse returns the reverse of the string value. @param text (String) - The string to revers @returns (String) - Returns a reversed version of the string.
func Right ¶
Right returns the rightmost characters of the string value. @param src (String) - The source string. @params length (Int) - The amount of characters to return. @returns substr (String)
func Sha1 ¶
Sha1 calculates the SHA1 checksum for text and returns it in a hexadecimal string representation. @param text (String) - 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 text (String) - 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. @params text (String) - The string to split. @params separator (String) - The sperator. @params limit (Int) - Limit the number of split values in the result. If no limit is given, the number of splits returned is not bounded. @returns strings (Array<String>) - Array of strings.
func Substitute ¶
Substitute replaces search values in the string value. @params text (String) - The string to modify @params search (String) - The string representing a search pattern @params replace (String) - The string representing a replace value @param limit (Int) - 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. @params value (String) - The source string. @param offset (Int) - Start at offset, offsets start at position 0. @param length (Int, optional) - At most length characters, omit to get the substring from offset to the end of the string. Optional. @returns substring (String) - A substring of value.
func ToBase64 ¶
ToBase64 returns the base64 representation of value. @param value (string) - The string to encode. @returns toBase64String (String) - A base64 representation of the string.
func Trim ¶
Trim returns the string value with whitespace stripped from the start and/or end. @param value (String) - The string. @param chars (String) - Overrides the characters that should be removed from the string. It defaults to \r\n \t. @returns (String) - The string without chars on both sides.
Types ¶
This section is empty.