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

goware/tldomains

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Top-Level Domain Parser

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

Usage

hostInfo := tldomains.Parse("mmmm.jello.co.uk")
// hostInfo.Subdomain = "mmmm"
// hostInfo.Domain = "jello"
// hostInfo.Suffix = "co.uk"

Build

make dist will update the tldomains.dat file from https://publicsuffix.org/list/effective_tld_names.dat and rebuild the library.

The tld data file is automatically bundled in this library for distribution in tldomains.dat.gen.go.

License

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

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