authelia/internal/middlewares/wrap.go
James Elliott 001589cd6d
feat(metrics): implement prometheus metrics (#3234)
Adds ability to record metrics and gather them for Prometheus.
2022-06-14 17:20:13 +10:00

15 lines
286 B
Go

package middlewares
import (
"github.com/valyala/fasthttp"
)
// Wrap a handler with another middleware if it isn't nil.
func Wrap(middleware Basic, next fasthttp.RequestHandler) (handler fasthttp.RequestHandler) {
if middleware == nil {
return next
}
return middleware(next)
}