ipld-eth-server/vendor/github.com/jbenet/go-is-domain
2019-12-02 13:24:49 -06:00
..
.travis.yml update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
doc.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
domainre.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
go.mod update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
is_domain.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
LICENSE update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
package.json update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
README.md update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
regenerate-tlds.sh update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
tlds_custom.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00
tlds_iana.go update dependencies to work with update eth-block-extractor 2019-12-02 13:24:49 -06:00

go-is-domain

This package is dedicated to @whyrusleeping.

Docs: https://godoc.org/github.com/jbenet/go-is-domain

Check whether something is a domain.


import (
  isd "github.com/jbenet/go-is-domain"
)

isd.IsDomain("foo.com") // true
isd.IsDomain("foo.bar.com.") // true
isd.IsDomain("foo.bar.baz") // false

MIT Licensed

Updating TLDs

To update non-extended TLDs, IANA publishes, you can retrieve them from data.iana.org.

After retrieving the updated list, enter them into the file tlds-alpha-by-domain.txt. In order to update the TLDs map in tlds.go, you can run the gen.sh script which will generate the contents of a string -> bool map. After that, you'll want to replace the contents of the existing TLDs map, with the one that was generated and stored in formatted_tlds.txt