Releases: zxdev/urlx
Release list
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3
Added validTLD with a ValidTLD() toggle method (default:on) to enforce only recognized valid old extensions in the parser.
Also clarified the Compare() method is a boolean equivalence comparison test for Apex and Host domain names. It's best to test for an IP first and take action at that branch point, however testing with an IP will report equivalence even though the apex field is empty because the intended logic is that when the Host and Apex forms are different a different or a secondary action would be taken based upon testing so plan the resultant logic flow accordingly.
v1.0.2
Adds the compare method for domains.
// Compare is a boolean comparison test for Apex and Host hostnames; the
// Apex form will always be empty on the parser failure or when an IP is
// detected so this sould only be used with domains
func (u *URL) Compare() bool {
return len(u.Apex) > 0 && len(u.Host) == len(u.Apex)
}
v1.0.1
v1.0.0
The urlx package is a simple url standardizer that parses a url into its constituant parts and will set several flags as part of the parser such as url.IP or url.IDNA flag when detected. The parser can be modified with various toggles, such as noWWW, noPort, noPage as well as various controls flags such as onlyIP, onlyApex, or onlyHost.
The Parser is used to generally confirms the hostname has the required format and generates the tld, apex, and host along with the tld kind for the domain and reports only the host for an IPv4/6 address.