Skip to content

Releases: rdapapi/rdapapi-go

v0.5.0

24 Apr 21:12

Choose a tag to compare

TLD catalog endpoints

Two new methods list the TLDs the API can resolve and how often each registry's RDAP server populates common fields. Neither endpoint counts against your monthly quota.

tlds, err := client.TLDs(ctx)
if err != nil {
    log.Fatal(err)
}

fmt.Printf("%d TLDs, coverage %.0f%%\n", tlds.Meta.Count, tlds.Meta.Coverage*100)
for _, tld := range tlds.Data {
    if tld.FieldAvailability != nil {
        fmt.Printf("%s: expires_at=%s\n", tld.TLD, tld.FieldAvailability.ExpiresAt)
    }
}

Filters: WithSince (ISO 8601), WithServer (hostname). Pass the previous ETag via WithIfNoneMatch to skip unchanged transfers. The method returns (nil, nil) on HTTP 304.

later, _ := client.TLDs(ctx, rdapapi.WithIfNoneMatch(tlds.ETag))
com, _ := client.TLD(ctx, "com")

New types: TldListResponse, TldResponse, TldEntry, TldListMeta, TldMeta, TldThresholds, FieldAvailability, AvailabilityLevel.

NotSupportedError

A new *NotSupportedError is returned on HTTP 404 when the API returns error: "not_supported" (no RDAP coverage for the TLD, IP range, or ASN range). It unwraps to *NotFoundError, so existing errors.As(err, &notFound) calls still match.

_, err := client.Domain(ctx, "example.nope")

var notSupported *rdapapi.NotSupportedError
if errors.As(err, &notSupported) {
    fmt.Println("TLD not covered by RDAP")
}

var notFound *rdapapi.NotFoundError
if errors.As(err, &notFound) {
    // Also matches the NotSupportedError above.
}

Install

go get github.com/rdapapi/rdapapi-go@v0.5.0

Full Changelog: v0.3.0...v0.5.0

v0.3.0

17 Mar 13:05

Choose a tag to compare

Full Changelog: v0.2.0...v0.3.0

Full Changelog: v0.2.0...v0.3.0

v0.2.0

28 Feb 10:31

Choose a tag to compare

What's New

  • Date convenience methods on Dates: RegisteredAt(), ExpiresAt(), UpdatedAt() (time.Time, bool) and ExpiresInDays() (int, bool)

Full Changelog: v0.1.0...v0.2.0

v0.1.0

25 Feb 19:04

Choose a tag to compare