input

package module
v0.0.0-...-27ea57c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2016 License: Apache-2.0, BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Overview

Package input provides utility methods for cleaning and validating common user input.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Invalid e-mail address.
	ErrInvalidEmail = errors.New("invalid e-mail address")
)

Functions

func NormalizeString

func NormalizeString(in string) string

Normalize string.

Normalizes the string to NFC and ditches any zero-width whitespace.

func ParseEmail

func ParseEmail(in string) (out string, err error)

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

func TrimSingleWhitespaceNormalizeLine(in string) string

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

func TrimWhitespaceNormalizeLine(in string) string

Trim whitespace normalize line.

Normalizes the string to NFC and replaces all Unicode whitespace characters with regular spaces, trimming the final result.

func WhitespaceNormalizeLine

func WhitespaceNormalizeLine(in string) string

Whitespace normalize line.

Normalizes the string to NFC and replaces all Unicode whitespace characters with regular spaces.

func WhitespaceNormalizeString

func WhitespaceNormalizeString(in string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL