signoz/pkg/http/middleware/middleware.go
Vibhu Pandey e7b5410c5b
feat(packages): add registry and http packages (#5740)
### Summary

Add packages for Registry and HTTP

#### Related Issues / PR's

https://github.com/SigNoz/signoz/pull/5710
2024-08-22 14:24:02 +05:30

21 lines
452 B
Go

package middleware
import "net/http"
const (
pkgname string = "go.signoz.io/pkg/http/middleware"
)
// Wrapper is an interface implemented by all middlewares
type Wrapper interface {
Wrap(http.Handler) http.Handler
}
// WrapperFunc is to Wrapper as http.HandlerFunc is to http.Handler
type WrapperFunc func(http.Handler) http.Handler
// WrapperFunc implements Wrapper
func (m WrapperFunc) Wrap(next http.Handler) http.Handler {
return m(next)
}