Documentation
¶
Overview ¶
Package inputcheck holds the format checks for values people type into forms: email addresses, host names, web addresses, folder paths and keys.
Each check returns "" when the value is fine (a blank value is fine too, so optional fields can use the same call) or a short, friendly sentence that can be shown to the person as it is. The same rules are written out in web/src/validate.ts so the page and the server agree.
The package depends on nothing else in the repo, so any package can use it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPURL ¶
HTTPURL wants an http or https web address with a server name in it. With requireScheme false, an address typed without http:// is accepted, for the forms that add the scheme themselves.
func Host ¶
Host wants a bare host name or IP address: no scheme, path or port. example is shown in the message, for instance "news.example.com".
func LooksLikeHost ¶
LooksLikeHost reports whether h is a host name, an IPv4 address or an IPv6 address, with no scheme, port or path (IPv6 without brackets).
func ValidEmail ¶
ValidEmail is deliberately loose (one @, something on both sides, a dot in the domain, no spaces): it catches typos, not every RFC quirk.
Types ¶
This section is empty.