mirror of
https://github.com/telanflow/mps.git
synced 2025-10-21 23:30:23 +08:00
init
This commit is contained in:
@@ -2,6 +2,12 @@ package mps
|
||||
|
||||
import "net/http"
|
||||
|
||||
type Middleware func(req *http.Request, resp *http.Response)
|
||||
type Middleware interface {
|
||||
Handle(req *http.Request, ctx *Context) (*http.Response, error)
|
||||
}
|
||||
|
||||
type a http.HandlerFunc
|
||||
type MiddlewareFunc func(req *http.Request, ctx *Context) (*http.Response, error)
|
||||
|
||||
func (f MiddlewareFunc) Handle(req *http.Request, ctx *Context) (*http.Response, error) {
|
||||
return f(req, ctx)
|
||||
}
|
||||
|
Reference in New Issue
Block a user