Skip to content
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

remove gorilla/mux (deprecated) #630

Merged
merged 1 commit into from
Jan 23, 2023
Merged

Conversation

jranson
Copy link
Member

@jranson jranson commented Jan 23, 2023

This patch duplicates gorilla/mux, which is archived / no longer supported, into a new router package; and implements a Router interface atop the original gorilla *Router struct (now lowercase r *router)

fixes #628

Signed-off-by: James Ranson [email protected]

@jranson jranson requested a review from jnichols-git January 23, 2023 00:33
@coveralls
Copy link

coveralls commented Jan 23, 2023

Pull Request Test Coverage Report for Build 3982313854

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 26 of 78 (33.33%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-4.6%) to 89.316%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/proxy/handlers/purge.go 0 1 0.0%
pkg/router/middleware.go 0 3 0.0%
pkg/router/regexp.go 0 6 0.0%
pkg/router/route.go 0 13 0.0%
pkg/router/router.go 0 29 0.0%
Totals Coverage Status
Change from base Build 3982074317: -4.6%
Covered Lines: 16068
Relevant Lines: 17990

💛 - Coveralls

@jranson jranson merged commit 720db93 into trickstercache:main Jan 23, 2023
@jranson jranson deleted the remove-gorilla branch January 23, 2023 16:09
type Router struct {
type Router interface {
ServeHTTP(http.ResponseWriter, *http.Request)
PathPrefix(string) *Route
Copy link
Contributor

@tamalsaha tamalsaha Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels weird to see pointer to an interface. Is this necessary?

@jranson
Copy link
Member Author

jranson commented Feb 24, 2023

hi @tamalsaha - not sure i understand here. While Router is an interface, Route is actually a struct. Just FYI, we'll be switching to https://github.com/julienschmidt/httprouter before we cut the next beta release, since it is much more performant than gorilla/mux.

@tamalsaha
Copy link
Contributor

While Router is an interface, Route is actually a struct.

Ah! Sorry, I missed that Router and Route thing. I understand now.

Just FYI, we'll be switching to julienschmidt/httprouter

Wow! It must be a major rework of the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate Gorilla Mux
4 participants