jakewarren / tldomains

Tiny library to parse the subdomain, domain, and tld extension from a host string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Top-Level Domain Parser

Tiny library to parse the subdomain, domain, and tld extension from a host string.

Usage

extract, err := tldomains.New("/tmp/tld.cache")
if err != nil {
	fmt.Fprintf(os.Stderr, "error creating cache: %s", err)
}
hostInfo := extract.Parse("mmmm.jello.co.uk")
// hostInfo.Subdomain = "mmmm"
// hostInfo.Root = "jello"
// hostInfo.Suffix = "co.uk"

License

http://mozilla.org/MPL/2.0/

Contributors ❤️

About

Tiny library to parse the subdomain, domain, and tld extension from a host string


Languages

Language:Go 94.4%Language:Makefile 5.6%