-
Notifications
You must be signed in to change notification settings - Fork 18
Add FCH #139
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new FCH client for the NDN-FCH service, enabling HTTP queries to retrieve router information.
- Introduces core types (Request, Response, Router) with helper functions to apply defaults and build query URLs.
- Implements the Query function to perform HTTP requests and parse responses into routers.
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (1)
std/ndn/fch/fch.go:47
- The function 'max' is referenced here but is not defined. Consider defining a helper function or using appropriate logic to ensure req.Count is at least 1.
req.Count = max(1, req.Count)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with the following code and it works.
res, err := fch.Query(context.Background(), fch.Request{})
if err != nil {
println(err)
} else {
retJson, _ := json.Marshal(res)
println(string(retJson))
}
# Conflicts: # go.mod # go.sum
we'll probably want to squash the commits during the merge to main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.