beeline-go: Index | Examples | Files

package hnygorilla

import ""

Package hnygorilla has Middleware to use with the Gorilla muxer.


hnygorilla has Middleware to wrap individual handlers, and is best used in conjunction with the nethttp WrapHandler function. Using these two together will get you an event for every request that comes through your application while also decorating the most interesting paths (the handlers that you wrap) with additional fields from the Gorilla patterns.

For a complete example showing this wrapper in use, please see the examples in



Package Files

doc.go gorilla.go

func Middleware Uses

func Middleware(handler http.Handler) http.Handler

Middleware is a gorilla middleware to add Honeycomb instrumentation to the gorilla muxer.


// assume you have handlers named root and hello
var root func(w http.ResponseWriter, r *http.Request)
var hello func(w http.ResponseWriter, r *http.Request)

r := mux.NewRouter()
// Routes consist of a path and a handler function.
r.HandleFunc("/", root)
r.HandleFunc("/hello/{person}", hello)

Package hnygorilla imports 5 packages (graph) and is imported by 2 packages. Updated 2020-07-18. Refresh now. Tools for package owners.