mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-13 17:14:44 +00:00
- Use gorilla/mux for middleware. - Add Dumper, RequestID, and Logger middlewares. - Add makeURL helper
12 lines
384 B
Go
12 lines
384 B
Go
package middleware
|
|
|
|
// contextKey is a value for use with context.WithValue. It's used as
|
|
// a pointer so it fits in an interface{} without allocation. This technique
|
|
// for defining context keys was copied from Go 1.7's new use of context in net/http.
|
|
type contextKey struct {
|
|
name string
|
|
}
|
|
|
|
func (k *contextKey) String() string {
|
|
return "chi/middleware context value " + k.name
|
|
}
|