Documentation ¶
Index ¶
- func Clean(input string) (cleaned string)
- func CleanRelativePath(path string) (cleaned string)
- func CleanRequestPath(path string) (cleaned string)
- func KebabRelativePath(path string) (kebab string)
- func Sanitize(input string) (sanitized string)
- func StrictClean(input string) (cleaned string)
- func StrictCleanKebabValue(name string) (cleaned string)
- func StrictSanitize(input string) (sanitized string)
- func TrimQueryParams(path string) (trimmed string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clean ¶ added in v0.5.0
Clean unescapes any HTML entities after using Sanitize on the given input
func CleanRelativePath ¶ added in v0.5.0
CleanRelativePath is the same as CleanRequestPath except the cleaned result is a relative file path (has no leading slash character)
func CleanRequestPath ¶ added in v0.5.0
CleanRequestPath splits the given path into segments, using StrictClean on each segment while reassembling the cleaned output as an absolute file path (has a leading slash character)
func KebabRelativePath ¶ added in v0.5.0
KebabRelativePath uses CleanRelativePath on the given string, splits it into path segments and renders each segment in kebab-cased format
ie: KebabRelativePath("lowerCamel/CamelCased/snake_cased") == "lower-camel/camel-cased/snake-cased"
func StrictClean ¶ added in v0.5.0
StrictClean is the same as Clean except it uses StrictSanitize on the given input
func StrictCleanKebabValue ¶ added in v0.5.0
StrictCleanKebabValue uses StrictClean on the given string, replaces all slashes with dashes and renders the string in kebab-cased format
func StrictSanitize ¶ added in v0.5.0
StrictSanitize uses bluemonday.StrictPolicy to sanitize the given input
func TrimQueryParams ¶
TrimQueryParams truncates the given string at the first question mark character
Types ¶
This section is empty.