// Use adds a middleware to the service wide middleware chain.
// goa comes with a set of commonly used middleware, see the middleware package.
// Controller specific middleware should be mounted using the Controller struct Use method instead.
185649
func (service *Service) Use(m Middleware) {
	service.middleware = append(service.middleware, m)
}
501189
func (r *Router) Use(middlewares ...Middleware) {
	r.middlewares = append(r.middlewares, middlewares...)
}
1362874
func (r *Router) Use(mc MiddlewareChain) {
	r.middleware = r.middleware.ExtendFrom(mc)
}
891176
func (f *Fibre) Use(m MiddlewareFunc) MiddlewareFunc {
	f.middleware = append(f.middleware, m)
	return m
}
597280
func (c *idCache) use(id ID) bool {
	if _, exists := c.leased[id]; !exists {
		return false
	}

	delete(c.leased, id)
	return true
}
929077
func (r *Request) UseHandler(phase string, fn context.HandlerFunc) *Request {
	r.Middleware.UseHandler(phase, 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)
	}
}
356166
func (r *routerGroup) Use(f func(next http.Handler) http.Handler) {
	r.chain = r.chain.Append(f)
}
633646
func Middleware(config Config) func(http.Handler) http.Handler {
	return New(config).Middleware()
}
490929
func (r *PortAllocator) Used() int {
	return r.portRange.Size - r.alloc.Free()
}
374015
func (r *Router) Use(middleware ...Middleware) {
	if r.parent != nil {
		panic("subrouters can't use middleware!")
	}
	r.middleware = append(r.middleware, middleware...)
}
306922
func (g *Group) Use(filters ...Filter) {
	g.filters = append(g.filters, filters...)
}
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)
	}
}
631987
func (r *RouteGroup) Use(handlers ...Handler) {
	r.handlers = append(r.handlers, handlers...)
}
1024021
func (m *Martini) Use(handler Handler) {
	validateHandler(handler)

	m.handlers = append(m.handlers, handler)
}
859002
func (s *Layer) Use(plugin plugin.Plugin) Middleware {
	s.mtx.Lock()
	s.stack = append(s.stack, plugin)
	s.mtx.Unlock()
	return s
}
602161
func (g *routeGroup) Use(m ...Middleware) {
	g.middleware = append(g.middleware, m...)
}