1
0
mirror of https://github.com/0rangebananaspy/authelia.git synced 2024-09-14 22:47:21 +07:00
authelia/internal/middlewares/wrap.go
James Elliott 001589cd6d
feat(metrics): implement prometheus metrics ()
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)
}