MCPcopy Index your code
hub / github.com/domainr/whois

github.com/domainr/whois @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
72 symbols 172 edges 17 files 36 documented · 50%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Whois

GoDoc

go get github.com/domainr/whois

Whois client for Go (golang), inspired by Ruby Whois. Currently in production use at Domainr.

Design

func whois.Whois(query string) *whois.Record  // Fetches and returns a fully-parsed whois.Record

request = whois.NewRequest(query)             // Returns a prepared whois.Request
response = whois.DefaultClient.Fetch(request) // Fetches the request, returns a whois.Response
record = response.Parse()                     // (not implemented yet) Parses the response, returns a whois.Record

whois.Request  // represents a qualified whois request, including server, URL, and request body
whois.Response // intermediate record, raw response from a whois server for a given query
whois.Record   // parsed whois response; structured data

Logic

query := "domai.nr"
request, err := whois.NewRequest(query)
response, err := whois.DefaultClient.Fetch(request)
record, err := response.Parse() // not implemented yet
if record.Refer != "" {
  response = whois.FetchRefer(record)
}

TODO

  • [X] Create whois.Client
  • [X] Embed an http.Client in whois.Client to reuse state
  • [ ] Implementations for known HTTP-based whois servers
  • [ ] Parsers

Credits

This code is made available under an MIT license. See LICENSE for more information.

© nb.io, LLC

Extension points exported contracts — how you extend this code

Adapter (Interface)
Adapter contains server-specific code for retrieving and parsing whois data. [2 implementers]
adapter.go

Core symbols most depended-on inside this repo

BindAdapter
called by 7
adapter.go
NewResponse
called by 5
response.go
Prepare
called by 4
adapter.go
FatalIf
called by 4
cmd/client/main.go
NewRequest
called by 3
request.go
DetectContentType
called by 3
response.go
NewClient
called by 3
client.go
logError
called by 3
client.go

Shape

Method 31
Function 27
Struct 13
Interface 1

Languages

Go100%

Modules by API surface

response.go15 symbols
client.go11 symbols
adapter.go8 symbols
response_test.go5 symbols
request.go4 symbols
adapter_nr.go4 symbols
adapter_verisign.go3 symbols
adapter_name.go3 symbols
adapter_de.go3 symbols
adapter_bd.go3 symbols
adapter_az.go3 symbols
adapter_ar.go3 symbols

For agents

$ claude mcp add whois \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact