Documentation
¶
Overview ¶
Package input provides utility methods for cleaning and validating common user input.
Index ¶
- Variables
- func NormalizeString(in string) string
- func ParseEmail(in string) (out string, err error)
- func TrimSingleWhitespaceNormalizeLine(in string) string
- func TrimWhitespaceNormalizeLine(in string) string
- func WhitespaceNormalizeLine(in string) string
- func WhitespaceNormalizeString(in string) string
Constants ¶
This section is empty.
Variables ¶
var ( // Invalid e-mail address. ErrInvalidEmail = errors.New("invalid e-mail address") )
Functions ¶
func NormalizeString ¶
Normalize string.
Normalizes the string to NFC and ditches any zero-width whitespace.
func ParseEmail ¶
Parse e-mail.
Lower-cases the entire e-mail address and normalizes the domain part with IDNA encoding. This method does not allow IP address domain parts, nor quoted user parts.
func TrimSingleWhitespaceNormalizeLine ¶
Trim single-whitespace normalize line.
Normalizes the string to NFC and replaces all Unicode whitespace characters with regular spaces, trimming the final result. Multiple whitespaces are combined into one whitespace.
func TrimWhitespaceNormalizeLine ¶
Trim whitespace normalize line.
Normalizes the string to NFC and replaces all Unicode whitespace characters with regular spaces, trimming the final result.
func WhitespaceNormalizeLine ¶
Whitespace normalize line.
Normalizes the string to NFC and replaces all Unicode whitespace characters with regular spaces.
func WhitespaceNormalizeString ¶
Whitespace normalize string.
Normalizes the string to NFC and replaces all non-line-breaking Unicode whitespace characters with regular spaces, and ditches any carriage returns.
Types ¶
This section is empty.