Skip to content

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

Notifications You must be signed in to change notification settings

jakewarren/tldomains

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 94.4%
  • Makefile 5.6%