Documentation ¶
Overview ¶
Package pphttprouter instruments the julienschmidt/httprouter package (https://github.com/julienschmidt/httprouter).
This package instruments inbound requests handled by a httprouter.Router. Use New() to trace all handlers:
r := pphttprouter.New() r.GET("/", Index) r.GET("/hello/:name", Hello)
Use WrapHandle to select the handlers you want to track:
r := httprouter.New() r.GET("/", Index) r.GET("/hello/:name", pphttprouter.WrapHandle(hello))
Index ¶
- func WrapHandle(handler httprouter.Handle) httprouter.Handle
- type Router
- func (r *Router) DELETE(path string, handle httprouter.Handle)
- func (r *Router) GET(path string, handle httprouter.Handle)
- func (r *Router) HEAD(path string, handle httprouter.Handle)
- func (r *Router) Handle(method, path string, handle httprouter.Handle)
- func (r *Router) Handler(method, path string, handler http.Handler)
- func (r *Router) HandlerFunc(method, path string, handler http.HandlerFunc)
- func (r *Router) OPTIONS(path string, handle httprouter.Handle)
- func (r *Router) PATCH(path string, handle httprouter.Handle)
- func (r *Router) POST(path string, handle httprouter.Handle)
- func (r *Router) PUT(path string, handle httprouter.Handle)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapHandle ¶
func WrapHandle(handler httprouter.Handle) httprouter.Handle
WrapHandle wraps the given httprouter handler and adds the pinpoint.Tracer to the request's context. By using the pinpoint.FromContext function, this tracer can be obtained.
Types ¶
type Router ¶
type Router struct {
*httprouter.Router
}
func New ¶
func New() *Router
New returns a new Router which will instrument all added httprouter.Router handlers.
func (*Router) HandlerFunc ¶
func (r *Router) HandlerFunc(method, path string, handler http.HandlerFunc)
Click to show internal directories.
Click to hide internal directories.