Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a new GetRoutes method to the Route interface, which allows retrieving all registered routes, and provides a corresponding mock implementation along with a new RouteInfo struct to encapsulate route metadata.
- Added GetRoutes method to the Route interface in contracts/route/route.go
- Implemented a mock version of GetRoutes in mocks/route/Route.go
- Introduced the RouteInfo struct to represent metadata (method, path, handler)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| mocks/route/Route.go | Added a GetRoutes mock method with helper functions |
| contracts/route/route.go | Updated Route interface and added RouteInfo struct |
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: 3219f8a | Previous: e1d6732 | Ratio |
|---|---|---|---|
Benchmark_Fatal |
2e-7 ns/op 0 B/op 0 allocs/op |
1e-7 ns/op 0 B/op 0 allocs/op |
2 |
Benchmark_Fatal - ns/op |
2e-7 ns/op |
1e-7 ns/op |
2 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1063 +/- ##
==========================================
+ Coverage 71.28% 71.31% +0.03%
==========================================
Files 181 181
Lines 12732 12732
==========================================
+ Hits 9076 9080 +4
+ Misses 3266 3263 -3
+ Partials 390 389 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📑 Description
Closes goravel/goravel#632
This pull request introduces a new method,
GetRoutes, to theRouteinterface incontracts/route/route.gofor retrieving all registered routes, along with its implementation in the mockRouteobject inmocks/route/Route.go. Additionally, it defines a newRouteInfostruct to encapsulate route metadata such as method, path, and handler.Enhancements to route management:
GetRoutesmethod toRouteinterface: Enables retrieval of all registered routes in the router.RouteInfostruct: Represents metadata for routes, including HTTP method, path, and handler name.Mock implementation updates:
GetRoutesin mockRoute: Provides a mock function for testing theGetRoutesmethod, including helper methods likeReturnandRunAndReturnfor defining mock behavior.✅ Checks