Need help with this RDAP git repo

I’m learning this RDAP repo I know it starts with main.go under cmd/rdap, then the cli.go for RunCLI function. but for this size of project written in golang, can I get some help regarding how/where to decompose and decipher this go codes and structure? it’s a bit overwhleming for me.



Do you have an objective (e.g. bug hunting) when you trace the codes? If not, it will be demotivating and overwhelming. :slight_smile:

When dealing with large size repository, you must go in with an objective (e.g. adding feature X, tracking a bug, extracting an algorithm etc.). If it has documentations, you might need to read it especially the “architecture” section to avoid getting lost in the code jungles.

You can also contact the project developers and raise an “issue” ticket to ask them question (TIP: make sure you clarify you’re new, you’re interested to use the software). Developers love to help you out as all of us are passionate about our users.

Otherwise, you’re gambling with time to wait for another person-with-interest to read the codes with you.

1 Like

I’m trying to follow the instruction showed in client.go advanced usage line 45 -70 and do a domain query ( as example) with this server following is my code, but get No RDAP servers responded successfully (tried 1 server(s)) error. this does work on their command line interface like rdap -s, and now I want to use code to implement this and get error. any idea?

package main

import (
	_ "context"

func main() {
	// Advanced usage:
	// This demonstrates custom FetchRoles, a custom Context, a custom HTTP client,
	// a custom Bootstrapper, and a custom timeout.
	//   // Nameserver query on
	server, _ := url.Parse("")
	  req := &rdap.Request{
	    Type: rdap.DomainRequest,
	    Query: "",
	    FetchRoles: []string{"all"},
	    Timeout: time.Second * 45, // Custom timeout.

	    Server: server,

	  //req = req.WithContext(context.Context) // Custom context (see

	  client := &rdap.Client{}
	  //client.HTTP = &http.Client{} // Custom HTTP client.
	  //client.Bootstrap = &bootstrap.Client{} // Custom bootstapper.

	  resp, err := client.Do(req)
	  if err != nil {

	  if ns, ok := resp.Object.(*rdap.Domain); ok {
	    fmt.Printf("Handle=%s Domain=%s\n", ns.Handle, ns.LDHName)

Post this to new issue. I’ll reply from there.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.