Releases: rdapapi/rdapapi-go
v0.5.0
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, ¬Found) calls still match.
_, err := client.Domain(ctx, "example.nope")
var notSupported *rdapapi.NotSupportedError
if errors.As(err, ¬Supported) {
fmt.Println("TLD not covered by RDAP")
}
var notFound *rdapapi.NotFoundError
if errors.As(err, ¬Found) {
// 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
Full Changelog: v0.2.0...v0.3.0
Full Changelog: v0.2.0...v0.3.0
v0.2.0
What's New
- Date convenience methods on
Dates:RegisteredAt(),ExpiresAt(),UpdatedAt()(time.Time, bool) andExpiresInDays()(int, bool)
Full Changelog: v0.1.0...v0.2.0
v0.1.0
Full Changelog: https://github.com/rdapapi/rdapapi-go/commits/v0.1.0