-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(transport): expose server implementation on transport #3279
base: main
Are you sure you want to change the base?
Conversation
This change looks strange, I don't know why it's done this way |
I'm more than happy to answer any questions. My approach exactly mirrors the way |
For now I'm forced to work around this by post-processing the generated code with: # hack: ensure http handlers capture server
sed -i 's/http.SetOperation/http.SetServer(ctx, srv)\n\t\t&/g' ../internal/api/server/v1/*_http.pb.go |
770214f
to
4acc6b6
Compare
70ded83
to
3ba0225
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3279 +/- ##
==========================================
- Coverage 84.12% 81.74% -2.38%
==========================================
Files 89 92 +3
Lines 4182 4327 +145
==========================================
+ Hits 3518 3537 +19
- Misses 471 600 +129
+ Partials 193 190 -3 ☔ View full report in Codecov by Sentry. |
Description (what this PR does / why we need it):
Expose the server implementation on
Transporter
, similar to what's available in GRPC interceptors. This gives middlewares the ability to make decisions or delegate functionality to the server/handlers that do the work.Example middleware that delegates authentication checks to the server handler:
This is an additive change that requires HTTP servers to be regenerated since they need to call
http.SetServer
alongside the existinghttp.SetOperation
.