mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-23 05:42:30 +00:00
Use gorilla/mux for middleware and extend
- Use gorilla/mux for middleware. - Add Dumper, RequestID, and Logger middlewares. - Add makeURL helper
This commit is contained in:
parent
93ce24d3f3
commit
be815d0a41
323 changed files with 90756 additions and 16711 deletions
18
vendor/github.com/gorilla/mux/context.go
generated
vendored
Normal file
18
vendor/github.com/gorilla/mux/context.go
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
package mux
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func contextGet(r *http.Request, key interface{}) interface{} {
|
||||
return r.Context().Value(key)
|
||||
}
|
||||
|
||||
func contextSet(r *http.Request, key, val interface{}) *http.Request {
|
||||
if val == nil {
|
||||
return r
|
||||
}
|
||||
|
||||
return r.WithContext(context.WithValue(r.Context(), key, val))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue