mirror of
https://github.com/dstotijn/hetty.git
synced 2025-07-01 18:47:29 -04:00
Add middleware chaining for request and response modifiers
This commit is contained in:
@ -7,5 +7,18 @@ var (
|
||||
nopResModifier = func(res *http.Response) error { return nil }
|
||||
)
|
||||
|
||||
// RequestModifyFunc defines a type for a function that can modify a HTTP
|
||||
// request before it's proxied.
|
||||
type RequestModifyFunc func(req *http.Request)
|
||||
|
||||
// RequestModifyMiddleware defines a type for chaining request modifier
|
||||
// middleware.
|
||||
type RequestModifyMiddleware func(next RequestModifyFunc) RequestModifyFunc
|
||||
|
||||
// ResponseModifyFunc defines a type for a function that can modify a HTTP
|
||||
// response before it's written back to the client.
|
||||
type ResponseModifyFunc func(res *http.Response) error
|
||||
|
||||
// ResponseModifyMiddleware defines a type for chaining response modifier
|
||||
// middleware.
|
||||
type ResponseModifyMiddleware func(ResponseModifyFunc) ResponseModifyFunc
|
||||
|
Reference in New Issue
Block a user