tlds

Serialised TLDs in Go

https://github.com/jakewilliami/tlds

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.0%) to scientific vocabulary
Last synced: 9 months ago · JSON representation ·

Repository

Serialised TLDs in Go

Basic Info
  • Host: GitHub
  • Owner: jakewilliami
  • License: mit
  • Language: Go
  • Default Branch: master
  • Homepage:
  • Size: 280 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 1
  • Releases: 10
Created over 2 years ago · Last pushed 10 months ago
Metadata Files
Readme License Citation

README.md

Serialised TLDs in Go

A small library that provides serialised basic information about top level domains (TLDs).

An additional command-line utility, tldinfo, is provided.


Quick Start

Using the Library

Get the module: bash $ go get github.com/jakewilliami/tlds

Basic library usage: ```go package main

import ( "fmt"

"github.com/jakewilliami/tlds"

)

func main() { tld := tlds.Map[".jp"] country := tld.Country fmt.Printf("%v\n", country) // Japan } ```

Types: ```go type TLD struct { Domain string Type TLDType Manager string Country string }

const ( Generic TLDType = "generic" CountryCode TLDType = "country-code" Sponsored TLDType = "sponsored" Test TLDType = "test" GenericRestricted TLDType = "generic-restricted" Infrastructure TLDType = "infrastructure" ) ```

Using the CLI

Compile: bash $ ./build.sh # All-in-one build script, including updating generated const file $ go build -o ./tldinfo cmd/tldinfo/main.go # Or build it into a binary

Run: bash $ ./tldinfo jp # or ./tldinfo .jp $ ./tldinfo -h # help command coming soon™!

Similar Projects

This library/CLI is not a top-level domain parser. For parsers, see github.com/jpillora/go-tld/golang.org/x/net/publicsuffix/github.com/bobesa/go-domain-util.

This project is more similar to a top-level domain validator such as github.com/bombsimon/tld-validator, which looks like a very good project, even with unicode support using the golang.org/x/net IDNA submodule. Simon's TLD validator even generates a constant/static list of TLDs for library/offline use. However, this package does not retain any of the other TLD information defined by the IANA as it pulls from a different source to us. Ultimately, Simon's TLD validator provides a different functionality to ours, but I really recommend checking it out as it seems to be well-written and you may be after simple validation, in which case tld-validator may be the best package for you.

Another tool that deals with ISO-3166 in a much broader scope is github.com/biter777/countries. It primarily deals with country codes, but also has support for country codes.

Caveats

  • Currently only supports country code TLDs (ccTLDs), as this is my personal main usecase for the application. It does not yet generic TLDs (gTLD).
  • Internationalised ccTLDs are not yet supported.

Project Structure

Library files are in the root directory. Command-line tools are in the cmd/ subdirectory. The primary command line tool at time of writing simply states the country associated with a TLD. Internal tools are in the tools/ subdirectory (these are tools that help with package development).

Citation

If your research depends on tlds, please consider giving us a formal citation: citation.bib

Owner

  • Name: Jake Ireland
  • Login: jakewilliami
  • Kind: user
  • Location: ///scary.zealous.twin

Citation (citation.bib)

@software{ireland2025tlds,
  title={Serialised TLDs in Go},
  author={Ireland, Jake W},
  year={2025},
  howpublished={\url{https://github.com/jakewilliami/tlds}},
  note={{Go} package version v1.0.0}
}

GitHub Events

Total
  • Create event: 1
  • Issues event: 1
  • Release event: 1
  • Delete event: 1
  • Push event: 3
Last Year
  • Create event: 1
  • Issues event: 1
  • Release event: 1
  • Delete event: 1
  • Push event: 3

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jakewilliami (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 10
proxy.golang.org: github.com/jakewilliami/tlds
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.2%
Average: 5.4%
Dependent repos count: 5.6%
Last synced: 10 months ago

Dependencies

go.mod go
  • github.com/biter777/countries v1.6.6
  • github.com/nfx/go-htmltable v0.4.0
  • golang.org/x/net v0.0.0-20220909164309-bea034e7d591
go.sum go
  • github.com/biter777/countries v1.6.6
  • github.com/nfx/go-htmltable v0.4.0
  • golang.org/x/net v0.0.0-20220909164309-bea034e7d591