-
Notifications
You must be signed in to change notification settings - Fork 106
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
routing/http: feat: add streaming support #18
Conversation
013e55a
to
b24943a
Compare
Codecov Report
@@ Coverage Diff @@
## main #18 +/- ##
==========================================
+ Coverage 47.79% 48.03% +0.24%
==========================================
Files 274 279 +5
Lines 33237 33439 +202
==========================================
+ Hits 15885 16063 +178
- Misses 15673 15694 +21
- Partials 1679 1682 +3
|
498cfce
to
f21e4b7
Compare
@guseggert : what's remaining so this can move out of draft? |
7e82960
to
4dea63f
Compare
This commit was moved from ipfs/go-verifcid@c45e93b
2023-05-09 maintainer conversation:
|
This adds streaming support to the routing/v1 client and server by changing the interfaces to use iterators instead of slices, and adding content type negotation to the client and server.
Errors can just be packed inside of a struct, it over-complicates the interface to require errors as separate return values everywhere.
This is always needed, so we can simplify things by just including it in the main iterator interface.
These are practically the same, but cid.contact has already started using ndjson so we're just going to use that instead.
93b5f90
to
296fcef
Compare
Re: testing with cid.contact, I talked with @masih and I was wrong--this is not implemented in cid.contact yet. It is for IPNI APIs but not for routing/v1. Confirmed by wiring into Kubo, req Accept=application/x-ndjson,application/json but resp Content-Type=application/json. Tracking issue for this on their side: ipni/indexstar#92 I think the best option is to just go ahead and ship this in Kubo and let cid.contact own the integration testing when they are ready to deploy. |
12c75c2
to
d21f0c8
Compare
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, thanks! I also went over previous comments to check if everything was addressed. Let's finally merge this!
This adds streaming support to the routing/v1 client and server by changing the interfaces to use iterators instead of slices, and adding content type negotation to the client and server with
application/x-ndjson
support.