Add gorilla/mux router to gitaly
In https://gitlab.com/gitlab-org/gitaly/issues/37 I proposed a route POST /projects/123/hooks/post-receive
.
The request router in Go's standard library is not suited for routes like this because it works by prefixes; the /123/
in the middle throws it off.
We can choose to write an ad-hoc router (like we did in gitlab-workhorse) but I am not sure if that is good for the maintainability of the project. Alternatively we can use a third-party HTTP router:
I don't have experience with these so I don't have a preference. httprouter is supposedly faster; it has more GitHub stars and more recent commit activity than gorilla/mux.
I see three options for us now:
- change the route
POST /projects/123/hooks/post-receive
into something that works with the stdlib router - write an ad-hoc router that only supports
POST /projects/123/hooks/post-receive
- start using a third-party router package
cc @eReGeBe