mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-30 01:26:43 +08:00
13 lines
293 B
Go
13 lines
293 B
Go
package middleware
|
|
|
|
import (
|
|
. "github.com/mickael-kerjean/nuage/server/common"
|
|
"net/http"
|
|
)
|
|
|
|
func CtxInjector(fn func(App, http.ResponseWriter, *http.Request), ctx App) http.HandlerFunc {
|
|
return http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
|
|
fn(ctx, res, req)
|
|
})
|
|
}
|