Skip to content

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

Merged
merged 4 commits into from
Jun 28, 2025
Merged

Add FCH #139

merged 4 commits into from
Jun 28, 2025

Conversation

a-thieme
Copy link
Collaborator

No description provided.

@a-thieme a-thieme requested a review from pulsejet April 20, 2025 17:36
@a-thieme a-thieme added enhancement New feature or request std go-ndn issues labels Apr 20, 2025
@zjkmxy zjkmxy requested a review from Copilot April 20, 2025 21:31
Copy link
Contributor

@Copilot Copilot AI left a 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)

Copy link
Member

@zjkmxy zjkmxy left a 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))
}

a-thieme

This comment was marked as duplicate.

@a-thieme
Copy link
Collaborator Author

we'll probably want to squash the commits during the merge to main

Copy link
Member

@zjkmxy zjkmxy left a comment

Choose a reason for hiding this comment

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

LGTM

@zjkmxy zjkmxy merged commit 420daff into main Jun 28, 2025
9 checks passed
@zjkmxy zjkmxy deleted the FCH branch June 28, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request std go-ndn issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants