// Handle allows handling HTTP requests via an http.HandlerFunc, as opposed to an httptreemux.HandlerFunc.
// Any parameters from the request URL are stored in a map[string]string in the request's context.
15133
func (cg *ContextGroup) Handle(method, path string, handler http.HandlerFunc) {
	cg.group.Handle(method, path, func(w http.ResponseWriter, r *http.Request, params map[string]string) {
		if params != nil {
			r = r.WithContext(AddParamsToContext(r.Context(), params))
		}
		handler(w, r)
	})
}
1089814
func (g *GoHttpServer) Handle(w http.ResponseWriter, r *http.Request) {
	// This section is called if the developer has added custom mux to the app
	if g.HasAppMux && g.handleAppMux(w, r) {
		return
	}
	g.handleMux(w, r)
}
1277614
func (h *handler) Handle(req *Request) (interface{}, error) {
	switch req.Method {
	case "chat":
		return nil, h.handleChat(req)
	case "query":
		return h.handleQuery(req)
	}
	return nil, errInvalidMethod
}
291495
func (mux *Mux) Handle(ctx *Context, res *http.Response, err error) {
	mux.mu.RLock()
	defer mux.mu.RUnlock()
	if err != nil {
		// Find a matching error handler
		if h, ok := mux.errm[err]; ok {
			h.Handle(ctx, res, err)
			return
		}
		if h, ok := mux.errm[nil]; ok {
			h.Handle(ctx, res, err)
			return
		}
	} else {
		// Find a matching response handler
		var h Handler
		var n = -1
		for r := range mux.res {
			if ok, cnt := r.match(res); ok {
				if cnt > n {
					h, n = r.h, cnt
				}
			}
		}
		if h != nil {
			h.Handle(ctx, res, err)
			return
		}
	}
	mux.DefaultHandler.Handle(ctx, res, err)
}
1136224
func (fn GetOrderHandlerFunc) Handle(params GetOrderParams, principal *models.Principal) middleware.Responder {
	return fn(params, principal)
}
86941
func (n *Node) Handle(method string, handler interface{}) {
	if n.GetHandler(method) != nil {
		panic(fmt.Errorf(`"%s" already defined`, n.getSegments()))
	}
	n.handlers[method] = handler
	n.allow = append(n.allow, method)
}
903233
func (f HandlerFunc) Handle(c *Client, m *Message) {
	f(c, m)
}
1070006
func (r *Router) Handle(method, pattern string, handler http.Handler) Route {
	var p string
	if pattern == "/" && r.pattern != "" {
		p = r.pattern
	} else {
		p = r.pattern + pattern
	}

	built := r.buildMiddlewares(handler)

	rm := r.root().hostrm.Register(r.host)
	rt := rm.Register(method, p, built)

	// If this route does not exist in this Router instance then add it
	if _, ok := r.findRoute(rt); !ok {
		rt.pattern = p
		rt.host = r.host
		rt.pathMatcher = rm
		r.routes = append(r.routes, rt)
	}
	return rt
}
1244678
func (s *APIGroupHandler) handle(req *restful.Request, resp *restful.Response) {
	s.ServeHTTP(resp.ResponseWriter, req.Request)
}
253296
func (h *Handler) Handle(err error) {
	var interfaces []raven.Interface

	// Get HTTP request (if any)
	if req, ok := httperr.HTTPRequest(err); ok {
		interfaces = append(interfaces, raven.NewHttp(req))
	}

	packet := raven.NewPacketWithExtra(
		err.Error(),
		keyvals.ToMap(emperror.Context(err)),
		append(
			interfaces,
			raven.NewException(
				err,
				raven.GetOrNewStacktrace(emperror.ExposeStackTrace(err), 1, 3, h.client.IncludePaths()),
			),
		)...,
	)

	eventID, ch := h.client.Capture(packet, nil)

	if h.sendSynchronously && eventID != "" {
		<-ch
	}
}
1047902
func (handler *handler) Handle(_ <-chan struct{}, applications []string) error {
	return handler.config.Facade.Rescale(applications)
}
414449
func Handler(h http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
		rc := &responseCapture{w, 0}

		s := time.Now()
		h.ServeHTTP(rc, req)
		e := time.Now()
		d := e.Sub(s)

		data := Data{
			"start":    s,
			"end":      e,
			"duration": d,
			"status":   rc.statusCode,
			"method":   req.Method,
			"path":     req.URL.Path,
		}
		if len(req.URL.RawQuery) > 0 {
			data["query"] = req.URL.Query()
		}
		Event("request", GetRequestID(req), data)
	})
}
644731
func (h *basicHandler) Handle(c context.Context, conn net.Conn) {
	h.handlerFunc(c, conn)
}
642997
func Handle(mux *http.ServeMux, prefix string, handler Handler) {
	HandleAnnotations(mux, prefix, handler)
	HandleQuery(mux, prefix, handler)
	HandleSearch(mux, prefix, handler)

	// Registering a global handler is a common thing that applications do, to
	// avoid overriding one that may already exist we first check that none were
	// previously registered.
	root := path.Join("/", prefix)

	if _, pattern := mux.Handler(&http.Request{
		URL: &url.URL{Path: root},
	}); len(pattern) == 0 {
		mux.HandleFunc(root, func(res http.ResponseWriter, req *http.Request) {
			setResponseHeaders(res)
		})
	}
}
872949
func (m *Mux) Handle(expr string, handler http.Handler) error {
	return m.router.UpsertRoute(expr, handler)
}
1369535
func (hf HandlerFunc) Handle(ctx context.Context, command Command) (result interface{}, err error) {
	return hf(ctx, command)
}
1105643
func (c *UsergroupsCreateCall) Handle(handle string) *UsergroupsCreateCall {
	c.handle = handle
	return c
}