-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
📚 Doc: Add how to use NewCtxFunc and middleware at the same time #3328
📚 Doc: Add how to use NewCtxFunc and middleware at the same time #3328
Conversation
WalkthroughA new custom context with enhanced JSON response handling has been introduced. The changes add new structs and methods for response formatting and middleware control flow, as well as corresponding updates in documentation and tests. Additionally, a proxy test now leverages a dynamically created local proxy server for controlled testing. Overall, the modifications improve context management and ensure consistency across middleware execution and route handling. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant CustomCtx
participant Middleware
participant RouteHandler
Client->>CustomCtx: HTTP Request
CustomCtx->>Middleware: Log context type (before Next)
Middleware->>CustomCtx: Invoke Next()
CustomCtx->>RouteHandler: Execute route handler
RouteHandler-->>CustomCtx: Return response
CustomCtx->>Middleware: Log context type (after Next)
CustomCtx-->>Client: Send JSON Response (via Response struct)
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🔇 Additional comments (5)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3328 +/- ##
==========================================
- Coverage 84.25% 84.18% -0.07%
==========================================
Files 116 116
Lines 11555 11555
==========================================
- Hits 9736 9728 -8
- Misses 1391 1397 +6
- Partials 428 430 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
thanks for that, as a user i would expect that this extra effort with the overlays of the next method is not necessary |
This is better, if there is no more discussion I will close this pr. |
I agree with you, i will check it |
Description
Add documentation that tells users how to use both NewCtxFunc and app.Use().
Fixes #3319
Changes introduced
List the new features or adjustments introduced in this pull request. Provide details on benchmarks, documentation updates, changelog entries, and if applicable, the migration guide.
Type of change
Please delete options that are not relevant.
Checklist
Before you submit your pull request, please make sure you meet these requirements:
/docs/
directory for Fiber's documentation.Commit formatting
Please use emojis in commit messages for an easy way to identify the purpose or intention of a commit. Check out the emoji cheatsheet here: CONTRIBUTING.md