-
Notifications
You must be signed in to change notification settings - Fork 115
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
[feature] fibernewrelic add skip middleware next function. #1148
Conversation
WalkthroughThe recent update introduces a new field, Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant FiberApp
participant NewRelicMiddleware
participant NextHandler
Client->>FiberApp: Send Request
FiberApp->>NewRelicMiddleware: Pass to Middleware
NewRelicMiddleware->>NewRelicMiddleware: Check `cfg.Next()`
alt `cfg.Next()` is true
NewRelicMiddleware->>NextHandler: Skip Middleware
else `cfg.Next()` is false
NewRelicMiddleware->>NewRelicMiddleware: Continue Middleware
end
NewRelicMiddleware->>FiberApp: Pass to Next Middleware/Handler
FiberApp->>Client: Return Response
Poem
Tip AI model upgrade
|
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- fibernewrelic/README.md (1 hunks)
- fibernewrelic/fiber.go (3 hunks)
Additional context used
Markdownlint
fibernewrelic/README.md
42-42: Expected: 1; Actual: 2
Multiple consecutive blank lines(MD012, no-multiple-blanks)
Additional comments not posted (4)
fibernewrelic/README.md (1)
32-41
: LGTM!The additions to the
Config
section are well-documented and align with the PR objectives.fibernewrelic/fiber.go (3)
28-30
: LGTM!The addition of the
Next
property to theConfig
struct is clear and well-documented.
39-39
: LGTM!The default value for the
Next
property inConfigDefault
is correctly set tonil
.
73-76
: LGTM!The conditional check for
cfg.Next
in theNew
function is correctly implemented.
@amantinetti could you add a testcase for the usage of this function |
@ReneWerner87 Test cases are added :D |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- fibernewrelic/fiber_test.go (1 hunks)
Additional comments not posted (2)
fibernewrelic/fiber_test.go (2)
276-306
: Test case for skipping middleware execution looks good.The test case ensures that the New Relic middleware is skipped when the
Next
function returnstrue
.
308-338
: Test case for continuing middleware execution looks good.The test case ensures that the New Relic middleware continues execution when the
Next
function returnsfalse
.
Add Next Function on config
Next defines a function to skip newrelic middleware when returned true.
Summary by CodeRabbit
New Features
Next
function in the configuration to allow skipping middleware based on a custom condition.Bug Fixes
ErrorStatusCodeHandler
in the configuration to provide more flexibility in handling status codes.Tests
Next
function in the middleware configuration.