Package rdap

RDAP registration-data client over https://rdap.org/domain/. Source: internal/rdap/rdap.go.


Event

type Event struct {
    Action string `json:"eventAction"`
    Date   string `json:"eventDate"`
}

Single RDAP event object; only registration actions are used.


Response

type Response struct {
    Events   []Event  `json:"events"`
    Entities []entity `json:"entities"`
}

Minimal parsed RDAP payload. Entities carry registrar roles and vCard arrays used for registrar extraction.


Result

type Result struct {
    Raw   []byte    // raw JSON, kept for --verbose output
    Resp  *Response // parsed payload
    Found bool      // false when the lookup failed
}

Query

func Query(ctx context.Context, client *http.Client, domain string, perCall time.Duration) (*Result, error)

Fetches RDAP JSON for domain with an Accept: application/json request, retrying transient failures up to 3 times. Non-2xx status and invalid JSON are errors.

ParameterDescription
ctxParent context; the global 15 second budget.
clientShared *http.Client; per-call deadline via context.
domainAlready-normalized domain to look up.
perCallPer-attempt deadline (5 seconds in the CLI).

RegistrationDate

func RegistrationDate(r *Result) string

Returns the YYYY-MM-DD date of the registration event, or "Unknown / Lookup Failed" when unavailable. Nil-safe.


Registrar

func Registrar(r *Result) string

Best-effort registrar name, or "Unknown". Prefers entities with the registrar role, falling back to the first vCard fn property. Nil-safe.


Licensed under the GNU General Public License v3 - Mark Robillard Jr (MARKMENTAL)