Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update example usage #219

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ import (
)

func main() {
// it requires a list of resolvers
resolvers := []string{"8.8.8.8:53", "8.8.4.4:53"}
// It requires a list of resolvers.
// Valid protocols are "udp", "tcp", "doh", "dot". Default are "udp".
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also be documented somewhere else, like making parseResolver an exported function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 - Just checked the readme and we are missing this info. Marking the PR as changes requested

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are reviewing the README tho, @Mzack9999. 😃

Are you suggesting creating a separate section? I'd rather have this documented within the code so it can be served by godoc. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol yeah, I think it would be probably useful here, it's quite an important functionality
Screenshot 2024-09-02 at 23 49 29

Something like:

  • supports resolvers ... (tcp, udp, doh, etc)

resolvers := []string{"8.8.8.8:53", "8.8.4.4:53", "tcp:1.1.1.1"}
retries := 2
hostname := "hackerone.com"
dnsClient := retryabledns.New(resolvers, retries)

dnsClient, err := retryabledns.New(resolvers, retries)
if err != nil {
log.Fatal(err)
}

ips, err := dnsClient.Resolve(hostname)
if err != nil {
Expand Down
Loading