Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidHostLabel ¶
IsValidHostLabel returns if the input is a single valid RFC 1123 host label. If allowSubDomains is true, will allow validation to include nested host labels. Returns false if the input is not a valid host label. If errors occur they will be added to the provided [ErrorCollector].
func SubString ¶
Substring returns the substring of the input provided. If the start or stop indexes are not valid for the input nil will be returned. If errors occur they will be added to the provided [ErrorCollector].
func URIEncode ¶
URIEncode returns an percent-encoded RFC3986 section 2.1 version of the input string.
Types ¶
type URL ¶
type URL struct { Scheme string // https://www.rfc-editor.org/rfc/rfc3986#section-3.1 Authority string // https://www.rfc-editor.org/rfc/rfc3986#section-3.2 Path string // https://www.rfc-editor.org/rfc/rfc3986#section-3.3 NormalizedPath string // https://www.rfc-editor.org/rfc/rfc3986#section-6.2.3 IsIp bool }
URL provides the structure describing the parts of a parsed URL returned by ParseURL.
func ParseURL ¶
ParseURL returns a URL if the provided string could be parsed. Returns nil if the string could not be parsed. Any parsing error will be added to the [ErrorCollector].
If the input URL string contains an IP6 address with a zone index. The returned [builtin.URL.Authority] value will contain the percent escaped (%) zone index separator.