Treblle with Go standard library
Introduction
Trebble middleware for Go works with applications based on net/http
.
Installation
Trebble uses Go Modules to manage dependencies.
Basic configuration
Configure Treblle at the start of your main()
function:
After that, just use the middleware with any of your handlers:
gorilla/mux
To setup the treblle.Middleware
in gorilla/mux
, you can use it as a global middleware:
per-route
You can also use treblle.Middleware
as a per-route middleware just like you will use it with net/http
:
Subroutes
You can also use treblle.Middleware
on gorilla/mux
subroutes: