[travis-badge]: https://img.shields.io/travis/taiyaeix/gtld-data.rs.svg?style=flat-square
[travis]: https://travis-ci.org/taiyaeix/gtld-data.rs
[license-badge]: https://img.shields.io/badge/license-ISC-blue.svg?style=flat-square
[license]: https://opensource.org/licenses/ISC
[![travis-badge][]][travis] [![license-badge][]][license]
# gtld-data.rs
Rust crate for gTLD data with a few useful functions. Updated daily.
All renames, additions, and removals of gTLD's are due to the IANA removing
their entries. As such, versioning may be a bit odd as this is updated every
day. As such, the versioning is something like this:
- Changes to existing entries are a MINOR-level change (x.2.z) -> (x.3.z).
- A new entry is a PATCH-level change (x.y.2) -> (x.y.3).
- A removed entry is a MAJOR-level change (1.y.z) -> (2.0.0).
The versions will be bumped appropriately immediately. Within a month, the
MAJOR version could be incremented by either 0 or 8.
Check the CHANGELOG.md file for breaking changes in terms of the functions
within this library. These are located at the top of the file under the
"BREAKING CHANGES" header.
### gTLD
> A Generic Top Level Domain (gTLD) is an internet domain name extension with
> three or more characters. It is one of the categories of the top level
> domain (TLD) in the Domain Name System (DNS) maintained by the Internet
> Assigned Numbers Authority.
>
> -- [icannwiki](http://icannwiki.com/GTLD)
### Installation
Add the following dependency to your Cargo.toml:
```rust
gtld-data = "^0.3"
```
And include it in your project:
```rust
extern crate gtld_data;
```
### Examples
Retrieve a `Vec` of all `Gtld` definitions:
```rust
let gtlds = gtld_data::all();
```
Check if a domain for a `Gtld` exists:
```rust
use gtld_data::domain_exists;
let exists = domain_exists("com");
```
Retrieve a `Vec` of `Gtld`s based on a given `GtldKind`:
```rust
use gtld_data::{GtldKind, get_by_kind};
let generics = get_by_kind(GtldKind::Generic);
assert!(generics.len() > 0);
```
Retrieve a `Vec` of `Gtld`s based on the name of the organization passed:
```rust
use gtld_data::get_by_organization;
let organization = "VeriSign Global Registry Services";
let gtlds = get_by_organization(organization);
assert!(gtlds.len() > 0);
```
### License
License info in [LICENSE.md]. Long story short, ISC.
[LICENSE.md]: https://github.com/taiyaeix/gtld-data.rs/blob/master/LICENSE.md