package srv type middlewareHandler func(req *Req, res Res) bool var middleware []middlewareHandler func AddMiddleware(fun middlewareHandler) { middleware = append(middleware, fun) }