Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidEmail ¶
IsValidEmail reports whether s is an address of the "Mailbox" rule of RFC 5321 section 4.1.2, which JSON Schema 2020-12 names for the `email` format and OpenAPI's Contact Object `email` takes as an email address.
That is a local part, an at sign, and a domain. The local part is a dot-string of atext characters or a quoted string, and the domain is a name of letter-digit-hyphen labels or an address literal in brackets. A display name, a comment, a list of addresses, and any byte outside printable ASCII are not part of the rule, so none is accepted.
One deliberate reading: an IPv4 address literal may not have a leading zero in an octet. RFC 5321 would allow it, but such a value is read as octal by some parsers, and the JSON Schema `ipv4` format forbids it for that reason.
func IsValidSPDXExpression ¶ added in v1.67.0
IsValidSPDXExpression reports whether s is a well-formed SPDX license expression: ids joined by the uppercase operators AND or OR, an id followed by WITH and an exception id, and parentheses for grouping. The ids are not checked against the SPDX license list.
func IsValidURL ¶ added in v1.67.0
IsValidURL reports whether s is a URI reference as RFC 3986 defines it, which is the format the OpenAPI Specification's schemas require of its URL fields. A relative reference such as "./terms.html" is valid, and so is any scheme. An http or https URL must also have a host, which RFC 9110 requires. The empty string is not accepted.
Types ¶
This section is empty.