Documentation
¶
Index ¶
- Variables
- func ConstantCase(text string) string
- func ContainsRune(value string, runee rune) bool
- func ContainsSubstring(value string, regex string) bool
- func Count(value, substr string) int
- func DashCase(text string) string
- func DateAfter(dateA time.Time, dateB time.Time) bool
- func DateBefore(dateA time.Time, dateB time.Time) bool
- func DateDay(date time.Time) uint
- func DateEqual(dateA time.Time, dateB time.Time) bool
- func DateFormat(date time.Time, format string) string
- func DateFuncs() map[string]any
- func DateHour(date time.Time) uint
- func DateMinute(date time.Time) uint
- func DateMonth(date time.Time) uint
- func DateMonthString(date time.Time) string
- func DateParse(value string, format string) time.Time
- func DateSecond(date time.Time) uint
- func DateWeekday(date time.Time) uint
- func DateWeekdayString(date time.Time) string
- func DateYear(date time.Time) uint
- func DateZone(date time.Time) string
- func DateZoneOffset(date time.Time) int
- func DromedaryCase(text string) string
- func EndsWith(value string, suffix string) bool
- func FilepathAbsolute(path string) string
- func FilepathBasename(path string) string
- func FilepathDirname(path string) string
- func FilepathExists(path string) bool
- func FilepathExtension(path string) string
- func FilepathFuncs() map[string]any
- func FilepathIsDirectory(path string) bool
- func FilepathIsFile(path string) bool
- func FilepathJoinPath(paths ...string) string
- func FilepathRelativise(path string, from string) string
- func FormatFormatAny(format string, args ...any) string
- func FormatFormatBytesIEC(num any) string
- func FormatFormatBytesSI(num any) string
- func FormatFormatFloat(num any, format string) string
- func FormatFormatInteger(num any, format string) string
- func FormatFormatOrdinal(num int) string
- func FormatFuncs() map[string]any
- func HTTPHeaderCase(text string) string
- func Index(value, substr string) int
- func IndexRune(value string, runee rune) int
- func JoinText(separator string, slice []string) string
- func LastIndex(value, substr string) int
- func LowerCase(text string) string
- func MathAbs(num any) any
- func MathAcos(num any) any
- func MathAcosh(num any) any
- func MathAsin(num any) any
- func MathAsinh(num any) any
- func MathAtan(num any) any
- func MathAtanh(num any) any
- func MathAvg(nums []any) float64
- func MathCeil(num any) any
- func MathCos(num any) any
- func MathCosh(num any) any
- func MathCubicRoot(num any) float64
- func MathFloor(num any) any
- func MathFuncs() map[string]any
- func MathGamma(num any) any
- func MathIsInf(num any, sign int) bool
- func MathIsNaN(num any) bool
- func MathLog(num any) any
- func MathLog10(num any) any
- func MathLog2(num any) any
- func MathMax(a any, b any) any
- func MathMin(a any, b any) any
- func MathPower(num any, exp any) float64
- func MathRandom(minimum, maximum any) any
- func MathRound(num any) any
- func MathSin(num any) any
- func MathSinh(num any) any
- func MathSquareRoot(num any) any
- func MathSum(nums []any) float64
- func MathTan(num any) any
- func MathTanh(num any) any
- func MathTrunc(num any) any
- func MiscFuncs() map[string]any
- func MiscIsBool(a any) bool
- func MiscIsFloat(a any) bool
- func MiscIsInteger(a any) bool
- func MiscIsMap(a any) bool
- func MiscIsRune(a any) bool
- func MiscIsSigned(a any) bool
- func MiscIsSlice(a any) bool
- func MiscIsString(a any) bool
- func MiscTypeOf(a any) string
- func PascalCase(text string) string
- func Repeat(value string, count int) string
- func ReplaceAll(value, old, news string) string
- func SentenceCase(text string) string
- func SlicesAfter(value []any, index uint) []any
- func SlicesBefore(value []any, index uint) []any
- func SlicesExists(value []any, element any) bool
- func SlicesFirst(value []any) any
- func SlicesFuncs() map[string]any
- func SlicesGet(value []any, index uint) any
- func SlicesLast(value []any) any
- func SlicesLength(value []any) uint
- func SlicesReverse(value []any) []any
- func SlicesSort(value []any, sortFunc func(any, any) int) []any
- func SlicesUnique(value []any) []any
- func SnailCase(text string) string
- func SplitWords(value string) []string
- func StartCase(text string) string
- func StartsWith(value string, prefix string) bool
- func StickyCase(text string) string
- func StringFuncs() map[string]any
- func TrainCase(text string) string
- func Trim(value string, chars []rune) string
- func TrimPrefix(value string, prefix string) string
- func TrimSpace(value string) string
- func TrimSuffix(value string, suffix string) string
- func URLDecodeQuery(query string) url.Values
- func URLDecodeURI(name string) string
- func URLEncodeQuery(params url.Values) string
- func URLEncodeURI(name string) string
- func URLFragment(name string) string
- func URLFuncs() map[string]any
- func URLHTMLEscape(name string) string
- func URLHTMLUnescape(name string) string
- func URLHost(name string) string
- func URLIsURL(name string) bool
- func URLJSONEscape(name string) string
- func URLJSONUnescape(name string) string
- func URLPath(name string) string
- func URLPathComponents(name string) []string
- func URLPort(name string) int
- func URLQuery(name string) string
- func URLScheme(name string) string
- func URLUserInfo(name string) string
- func URLXMLEscape(name string) string
- func UpperCase(text string) string
- type CutResult
- type Float
- type Integer
- type Number
- type Signed
- type Sizes
- type Unsigned
Constants ¶
This section is empty.
Variables ¶
var Functions = make(map[string]any)
Functions ¶
func ConstantCase ¶
ConstantCase converts the given string into constant case, while trimming leading and trailing whitespaces; for example CONSTANT_CASE
func ContainsRune ¶
func ContainsSubstring ¶
ContainsSubstring checks if value matches the given regex
func DashCase ¶
DashCase converts the given string into dash case, while trimming leading and trailing whitespaces; for example dash-case
func DateBefore ¶
DateBefore returns if dateB is before dateA
func DateFormat ¶
DateFormat formats the given date, using the given format
func DateMinute ¶
DateMinute returns the minute component of the given date
func DateMonthString ¶
DateMonthString returns the month component of the given date as a string
func DateParse ¶
DateParse parse the value as a date, using the given format, or the zero value if the format is invalid
func DateSecond ¶
DateSecond returns the second component of the given date
func DateWeekday ¶
DateWeekday returns the weekday component of the given date, as a 1 based integer
func DateWeekdayString ¶
DateWeekdayString returns the weekday component of the given date as a string
func DateZoneOffset ¶
DateZoneOffset returns the zone component of the given date, as a offset from UTC
func DromedaryCase ¶
DromedaryCase converts the given string into dromedary case, while trimming leading and trailing whitespaces; for example dromedaryCase
func FilepathAbsolute ¶
FilepathAbsolute returns the absolute path of the given path, using the current path to resolve it
func FilepathBasename ¶
FilepathBasename returns the file or directory name of the given path
func FilepathDirname ¶
FilepathDirname returns the parent path of the given path, as a absolute path
func FilepathExists ¶
FilepathExists checks if the given path exists
func FilepathExtension ¶
FilepathExtension returns the extension of the given file path, or empty if there is no extension, note that hidden directories under Unix return empty, as they are not files
func FilepathFuncs ¶
FilepathFuncs returns the map of the template functions that work on filepath
func FilepathIsDirectory ¶
FilepathIsDirectory checks if the given path exists and is a directory
func FilepathIsFile ¶
FilepathIsFile checks if the given path exists and is a file
func FilepathJoinPath ¶
FilepathJoinPath returns the joined path of concatenting all of the given path components with the current platform separator
func FilepathRelativise ¶
FilepathRelativise returns the relative path of the given path, using the from path to resolve it, if the from path is empty, then the current path is used
func FormatFormatAny ¶
FormatFormatAny formats the given string, using the standard fmt.Sprintf
func FormatFormatBytesIEC ¶
FormatFormatBytesIEC formats the given number as a IEC byte string, eg. 7896759 as 7.531 MB
func FormatFormatBytesSI ¶
FormatFormatBytesSI formats the given number as a SI byte string, eg. 7896759 as 7,897 MB
func FormatFormatFloat ¶
FormatFormatFloat formats the given float as a string, using the given format
func FormatFormatInteger ¶
FormatFormatInteger formats the given integer as a string, using the given format
func FormatFormatOrdinal ¶
FormatFormatOrdinal formats the given integer as an ordinal, eg. 3 as 3rd
func FormatFuncs ¶
FormatFuncs returns the map of the template functions that work on format
func HTTPHeaderCase ¶
HTTPHeaderCase converts the given string into http header case, while trimming leading and trailing whitespaces; for example Http-Header-Case
func MathCeil ¶
MathCeil return the mathematical ceil of the given num or NaN if the argument is not a number
func MathFloor ¶
MathFloor return the mathematical floor of the given num or NaN if the argument is not a number
func MathRandom ¶
MathRandom generates a random value between the given minimum and maximum or NaN if: - The arguments are not the same type - Maximum is less or equal to zero - Minimum is less than zero - Maximum is less or equal to minimum
func MiscIsInteger ¶
MiscIsInteger checks if the argument has an integer type
func MiscIsSigned ¶
MiscIsSigned checks if the number is signed or not
func MiscIsString ¶
MiscIsString checks if the argument has a string type
func MiscTypeOf ¶
MiscTypeOf returns a string corresponding to the type of a, either bool, integer, float, string, rune, slice or map
func PascalCase ¶
PascalCase converts the given string into pascal case, while trimming leading and trailing whitespaces; for example PascalCase. Note that if you have something like "this ,string" the result will be "This,string", only spaces, dashes and underscores will be removed!
func ReplaceAll ¶
func SentenceCase ¶
SentenceCase converts the given string into sentence case, while trimming leading and trailing whitespaces; for example Sentence case
func SlicesAfter ¶
SlicesAfter returns all of the items in an slices after the specified index
func SlicesBefore ¶
SlicesBefore returns all of the items in the collection before the specified count
func SlicesExists ¶
SlicesExists returns if an slices has the given element
func SlicesFirst ¶
SlicesFirst returns the first item or nil if it does not exist
func SlicesFuncs ¶
SlicesFuncs returns the map of the template functions that work on slices
func SlicesReverse ¶
SlicesReverse reverses the elements in an slices
func SlicesSort ¶
SlicesSort sort the given slices, using the given sort function
func SlicesUnique ¶
SlicesUnique returns an slices without any duplicates
func SnailCase ¶
SnailCase converts the given string into snail case, while trimming leading and trailing whitespaces; for example snail_case
func SplitWords ¶
SplitWords splits the given value by its words aka by spaces, while trimming leading and trailing whitespaces.
func StartCase ¶
StartCase converts the given string into start case, while trimming leading and trailing whitespaces; for example Start Case
func StartsWith ¶
StartsWith checks if the given value has the given prefix
func StickyCase ¶
StickyCase converts the given string into sticky case, while trimming leading and trailing whitespaces; for example StIcKyCaSe
func StringFuncs ¶
StringFuncs returns the map of the template functions that work on strings
func TrainCase ¶
TrainCase converts the given string into train case, while trimming leading and trailing whitespaces; for example TRAIN-CASE
func TrimPrefix ¶
TrimPrefix trims the leading prefix from the value string
func TrimSuffix ¶
TrimSuffix trims the trailing suffix from the value string
func URLDecodeQuery ¶
URLDecodeQuery decodes the given url query, to a Values object which is map[string][]string
func URLDecodeURI ¶
URLDecodeURI URI decodes the argument name
func URLEncodeQuery ¶
URLEncodeQuery encodes the given Values object which is map[string][]string, using URL query encoding
func URLEncodeURI ¶
URLEncodeURI URI encodes the argument name;
func URLFragment ¶
URLFragment returns the fragment of the given url, or empty if the URL is invalid or missing the fragment
func URLHTMLEscape ¶
URLHTMLEscape escapes the argument name, according to HTML rules;
func URLHTMLUnescape ¶
URLHTMLUnescape unescapes the argument name, according to HTML rules
func URLHost ¶
URLHost returns the host of the given url, or empty if the URL is invalid or missing the host
func URLJSONEscape ¶
URLJSONEscape escapes the argument name, according to JSON rules;
func URLJSONUnescape ¶
URLJSONUnescape unescapes the argument name, according to ecmascript rules
func URLPath ¶
URLPath returns the path of the given url, or empty if the URL is invalid or missing the path
func URLPathComponents ¶
URLPathComponents returns a slice with all path components of the given url, or an empty slice if the URL is invalid or missing the scheme
func URLPort ¶
URLPort returns the port of the given url, or -1 if the URL is invalid or missing the port
func URLQuery ¶
URLQuery returns the query of the given url, or empty if the URL is invalid or missing the query
func URLScheme ¶
URLScheme returns the scheme of the given url, or empty if the URL is invalid or missing the scheme
func URLUserInfo ¶
URLUserInfo returns the user info of the given url, or empty if the URL is invalid or missing the user info
func URLXMLEscape ¶
URLXMLEscape escapes the argument name, according to XML rules
Types ¶
type Sizes ¶
type Sizes uint
func MiscSizeof ¶
MiscSizeof returns the size of the number, either 8, 16, 32 or 64