Documentation ¶
Index ¶
- func CleanAndFormatText(input string) string
- func CleanTextSelect(s *goquery.Selection) string
- func CleanTextStr(s string) string
- func CookieDomain(url string) string
- func FormatResultsAsJson(mods types.ModInfo) (string, error)
- func PrintJson(data string)
- func PrintPrettyJson(data string, useAltColors ...bool) error
- func RemoveHTTPPrefix(url string) string
- func StrToInt(input string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanAndFormatText ¶
CleanAndFormatText processes the input string by removing escape characters, trimming quotes, and cleaning up whitespace. It returns a formatted string, either joining two non-empty lines with a comma or joining multiple lines with spaces.
func CleanTextSelect ¶
CleanTextSelect extracts the text from a goquery selection, trims whitespace, and returns the cleaned string.
func CleanTextStr ¶
CleanTextStr trims leading and trailing whitespace from the input string and returns the cleaned string.
func CookieDomain ¶
CookieDomain extracts and returns the base domain from a given URL by removing the protocol (http/https) and any paths or subdomains. It handles common domain extensions such as .com, .org, and .net.
func FormatResultsAsJson ¶
FormatResultsAsJson takes a ModInfo object, formats it as a pretty-printed JSON string, and returns the result. If marshalling fails, it returns an error.
func PrintJson ¶
func PrintJson(data string)
PrintJson prints a given JSON-formatted string to the standard output.
func PrintPrettyJson ¶
PrintPrettyJson takes a JSON string, unmarshals it into an object, and prints it with pretty formatting. Optionally, alternate colors can be used for keys and strings if useAltColors is provided and set to true. Returns an error if JSON unmarshalling or formatting fails.
func RemoveHTTPPrefix ¶
RemoveHTTPPrefix removes the http or https prefix from a given URL and returns the modified string.
Types ¶
This section is empty.