// Use registers the specified function as middleware.
// Middleware is always processed before any dispatching happens.
12220
func (r *Router) Use(fn http.HandlerFunc) *Router {
	r.Route("/*").All(fn)
	return r
}
669761
func (rtr *Router) Use(f func(http.ResponseWriter, *http.Request, http.HandlerFunc)) {
	srv := rtr.serveHandler
	rtr.serveHandler = func(rw http.ResponseWriter, req *http.Request) {
		f(rw, req, srv)
	}
}
1019008
func (p *Prometheus) Use(e *gin.Engine) {
	e.Use(p.HandlerFunc())
	p.SetMetricsPath(e)
}
717220
func (r *Router) Use(handle Middleware) *Router {
	r.mds = append(r.mds, handle)
	r.middleware = Compose(r.mds...)
	return r
}
25598
func (r *Router) UseFunc(middlewareFuncs ...MiddlewareFunc) {
	for _, fn := range middlewareFuncs {
		r.Use(MiddlewareFunc(fn))
	}
}
128665
func (e *Echo) Use(middleware ...MiddlewareFunc) {
	e.middleware = append(e.middleware, middleware...)
}
807086
func (app *App) UsePre(middleware interface{}) error {
	if middleware == nil {
		return ErrEmptyMiddleware
	}
	processor, err := app.middlewareProcessor(middleware)
	app.preMiddlewaresMu.Lock()
	if err == nil {
		app.preMiddlewares = append(app.preMiddlewares, processor)
	}
	app.preMiddlewaresMu.Unlock()

	return err
}
1098896
func Middleware() middleware.Middleware {
	return func(h http.Handler) http.Handler {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			nw := &responseWriter{
				ResponseWriter: w,
				t:              time.Now(),
			}
			h.ServeHTTP(nw, r)
		})
	}
}
358303
func (w *Weavebox) Use(handlers ...Middleware) {
	for _, h := range handlers {
		w.middleware = append(w.middleware, h)
	}
}
1001362
func (a *ActDepend) Use(ind int) ActionInterface {
	return a.getIndex(ind).Wrap()
}
612214
func (a *Application) Usage(args []string) {
	context, err := a.parseContext(true, args)
	a.FatalIfError(err, "")
	if err := a.UsageForContextWithTemplate(context, 2, a.usageTemplate); err != nil {
		panic(err)
	}
}
749832
func Use(c context.Context, s Client) context.Context {
	return context.WithValue(c, &contextKey, s)
}
1312245
func (c *Client) UseHandler(phase string, fn context.HandlerFunc) *Client {
	c.Middleware.UseHandler(phase, fn)
	return c
}
1257288
func (s *Slot) Use(ctx context.Context) context.Context {
	ctx, cancel := context.WithCancel(ctx)
	s.mu.Lock()
	s.cancel, cancel = cancel, s.cancel
	s.mu.Unlock()
	if cancel != nil {
		cancel()
	}
	return ctx
}
689339
func (s *PrioritySlot) Use(ctx context.Context, priority int) context.Context {
	ctx, cancel := context.WithCancel(ctx)
	s.mu.Lock()
	defer s.mu.Unlock()
	if s.shutdown {
		// Not accepting new processes.
		cancel()
		return ctx
	}
	if s.cancel == nil {
		// First use
		s.cancel = cancel
		s.priority = priority
		return ctx
	}
	if s.priority <= priority {
		// Argument wins
		s.cancel()
		s.cancel = cancel
		s.priority = priority
		return ctx
	}
	// Incumbent wins
	cancel()
	return ctx
}
833018
func (s *Server) UseMiddleware(m middleware.Middleware) {
	s.middlewares = append(s.middlewares, m)
}
1042401
func (s *Static) Middleware() echo.MiddlewareFunc {
	if s.middleware == nil {
		s.middleware = mw.Static(s.StaticOptions)
	}
	return s.middleware
}