mux

gorrila/mux

This library provides a middleware that extracts SQLCommenter HTTP request tags from a request being handled by gorrila/mux and attaches them to the request’s context. This same context, when used to run queries using sqlcommenter/go/database/sql, allows request tags and traceparent(if using otelmux) to be passed into SQL comments. Installation go get -u github.com/google/sqlcommenter/go/gorrila/mux Usage import ( "net/http" sqlcommentermux "github.com/google/sqlcommenter/go/gorrila/mux" "github.com/gorilla/mux" ) func runApp() { r := mux.NewRouter() r.Use(sqlcommentermux.SQLCommenterMiddleware) r.HandleFunc("/", ActionHome).Methods("GET") http. »