Documentation
¶
Overview ¶
Package utils provides simple various utilities
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatBytes ¶
FormatBytes returns a human readable size in IEC format.
func NormalizeSpaces ¶
NormalizeSpaces transforms all consecutive unicode space character to a single space in the input string. It then returns a space trimed string.
func ShortText ¶
ShortText returns a string of maxChars maximum length. It attempts to cut between words when possible.
func ShortURL ¶
ShortURL returns a string of maxChars maximum length where src is a URL. It attempts to nicely cut the path parts.
func Slug ¶
Slug replaces each run of characters which are not unicode letters or numbers with a single hyphen, except for leading or trailing runes. Letters will be stripped of diacritical marks and lowercased. Letter or number codepoints that do not have combining marks or a lower-cased variant will be passed through unaltered.
func ToLowerTextOnly ¶
ToLowerTextOnly returns a lowercased string with all spaces, punctuation and control characters removed.
Types ¶
This section is empty.