mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-06-04 11:25:52 +08:00
21 lines
452 B
Go
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)
|
|
}
|