// NewRouteRegister creates a new RouteRegister with all middlewares sent as params
352124
func NewRouteRegister(namedMiddleware ...RegisterNamedMiddleware) RouteRegister {
	return &routeRegister{
		prefix:          "",
		routes:          []route{},
		subfixHandlers:  []macaron.Handler{},
		namedMiddleware: namedMiddleware,
	}
}
803755
func NewRegistry(rate int, per time.Duration) *Registry {
	return &Registry{
		rate:     rate,
		per:      per,
		entities: make(map[string]*ratelimit.Bucket),
	}
}
905152
func NewForwarder(ctx context.Context, router, service string, next http.Handler) http.Handler {
	middlewares.GetLogger(ctx, "tracing", forwarderTypeName).
		Debugf("Added outgoing tracing middleware %s", service)

	return &forwarderMiddleware{
		router:  router,
		service: service,
		next:    next,
	}
}
1044665
func (s *RouterService) NewListRoutersParams() *ListRoutersParams {
	p := &ListRoutersParams{}
	p.p = make(map[string]interface{})
	return p
}
1059625
func NewRouteService(config *routeservice.RouteServiceConfig, routeRegistry registry.Registry, logger logger.Logger) negroni.Handler {
	return &RouteService{
		config:   config,
		registry: routeRegistry,
		logger:   logger,
	}
}
510790
func newRouter() *httprouter.Router {
	router := httprouter.New()
	router.ServeFiles("/public/*filepath", http.Dir("public"))

	if os.Getenv("ABOT_ENV") != "production" {
		initCMDGroup(router)
	}

	// Web routes
	router.HandlerFunc("GET", "/", hIndex)
	router.HandlerFunc("POST", "/", hMain)
	router.HandlerFunc("OPTIONS", "/", hOptions)

	// Route any unknown request to our single page app front-end
	router.NotFound = http.HandlerFunc(hIndex)

	// API routes (no restrictions)
	router.HandlerFunc("POST", "/api/login.json", hapiLoginSubmit)
	router.HandlerFunc("POST", "/api/logout.json", hapiLogoutSubmit)
	router.HandlerFunc("POST", "/api/signup.json", hapiSignupSubmit)
	router.HandlerFunc("POST", "/api/forgot_password.json", hapiForgotPasswordSubmit)
	router.HandlerFunc("POST", "/api/reset_password.json", hapiResetPasswordSubmit)
	router.HandlerFunc("GET", "/api/admin_exists.json", hapiAdminExists)

	// API routes (restricted by login)
	router.HandlerFunc("GET", "/api/user/profile.json", hapiProfile)
	router.HandlerFunc("PUT", "/api/user/profile.json", hapiProfileView)

	// API routes (restricted to admins)
	router.HandlerFunc("GET", "/api/admin/plugins.json", hapiPlugins)
	router.HandlerFunc("GET", "/api/admin/conversations_need_training.json", hapiConversationsNeedTraining)
	router.Handle("GET", "/api/admin/conversations/:uid/:fid/:fidt/:off", hapiConversation)
	router.HandlerFunc("PATCH", "/api/admin/conversations.json", hapiConversationsUpdate)
	router.HandlerFunc("POST", "/api/admins/send_message.json", hapiSendMessage)
	router.HandlerFunc("GET", "/api/admins.json", hapiAdmins)
	router.HandlerFunc("PUT", "/api/admins.json", hapiAdminsUpdate)
	router.HandlerFunc("GET", "/api/admin/remote_tokens.json", hapiRemoteTokens)
	router.HandlerFunc("POST", "/api/admin/remote_tokens.json", hapiRemoteTokensSubmit)
	router.HandlerFunc("DELETE", "/api/admin/remote_tokens.json", hapiRemoteTokensDelete)
	router.HandlerFunc("PUT", "/api/admin/settings.json", hapiSettingsUpdate)
	router.HandlerFunc("GET", "/api/admin/dashboard.json", hapiDashboard)
	return router
}
50771
func NewRouter() *Router {
	r := &Router{}
	r.root = &routingTreeNode{children: map[string]*routingTreeNode{}}
	return r
}
241292
func NewRouter() *Router {
	return &Router{
		mux:    mux.NewRouter(),
		routes: make(map[*mux.Route]*Route),
	}
}
717267
func (r *Router) Subrouter(mws ...Middleware) *Router {
	nr := &Router{
		parent:           r,
		hostrm:           r.hostrm,
		pattern:          r.pattern,
		middlewares:      Middlewares{},
		namedMiddlewares: make(map[string]Middlewares),
		host:             r.host,
		pool:             newCtxPool(),
		routes:           []*route{},
		subrouters:       []*Router{},
	}
	nr.Use(mws...)
	r.subrouters = append(r.subrouters, nr)
	return nr
}
474732
func newRouter(handler *Handler) *mux.Router {
	router := mux.NewRouter()
	router.HandleFunc("/", handler.handleHome).Methods("GET").Name("Home")
	router.HandleFunc("/cluster/resize/abort", handler.handlePostClusterResizeAbort).Methods("POST").Name("PostClusterResizeAbort")
	router.HandleFunc("/cluster/resize/remove-node", handler.handlePostClusterResizeRemoveNode).Methods("POST").Name("PostClusterResizeRemoveNode")
	router.HandleFunc("/cluster/resize/set-coordinator", handler.handlePostClusterResizeSetCoordinator).Methods("POST").Name("PostClusterResizeSetCoordinator")
	router.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux).Methods("GET")
	router.Handle("/debug/vars", expvar.Handler()).Methods("GET")
	router.HandleFunc("/export", handler.handleGetExport).Methods("GET").Name("GetExport")
	router.HandleFunc("/index", handler.handleGetIndexes).Methods("GET").Name("GetIndexes")
	router.HandleFunc("/index/{index}", handler.handleGetIndex).Methods("GET").Name("GetIndex")
	router.HandleFunc("/index/{index}", handler.handlePostIndex).Methods("POST").Name("PostIndex")
	router.HandleFunc("/index/{index}", handler.handleDeleteIndex).Methods("DELETE").Name("DeleteIndex")
	//router.HandleFunc("/index/{index}/field", handler.handleGetFields).Methods("GET") // Not implemented.
	router.HandleFunc("/index/{index}/field/{field}", handler.handlePostField).Methods("POST").Name("PostField")
	router.HandleFunc("/index/{index}/field/{field}", handler.handleDeleteField).Methods("DELETE").Name("DeleteField")
	router.HandleFunc("/index/{index}/field/{field}/import", handler.handlePostImport).Methods("POST").Name("PostImport")
	router.HandleFunc("/index/{index}/field/{field}/import-roaring/{shard}", handler.handlePostImportRoaring).Methods("POST").Name("PostImportRoaring")
	router.HandleFunc("/index/{index}/query", handler.handlePostQuery).Methods("POST").Name("PostQuery")
	router.HandleFunc("/info", handler.handleGetInfo).Methods("GET").Name("GetInfo")
	router.HandleFunc("/recalculate-caches", handler.handleRecalculateCaches).Methods("POST").Name("RecalculateCaches")
	router.HandleFunc("/schema", handler.handleGetSchema).Methods("GET").Name("GetSchema")
	router.HandleFunc("/schema", handler.handlePostSchema).Methods("POST").Name("PostSchema")
	router.HandleFunc("/status", handler.handleGetStatus).Methods("GET").Name("GetStatus")
	router.HandleFunc("/version", handler.handleGetVersion).Methods("GET").Name("GetVersion")

	// /internal endpoints are for internal use only; they may change at any time.
	// DO NOT rely on these for external applications!
	router.HandleFunc("/internal/cluster/message", handler.handlePostClusterMessage).Methods("POST").Name("PostClusterMessage")
	router.HandleFunc("/internal/fragment/block/data", handler.handleGetFragmentBlockData).Methods("GET").Name("GetFragmentBlockData")
	router.HandleFunc("/internal/fragment/blocks", handler.handleGetFragmentBlocks).Methods("GET").Name("GetFragmentBlocks")
	router.HandleFunc("/internal/fragment/data", handler.handleGetFragmentData).Methods("GET").Name("GetFragmentData")
	router.HandleFunc("/internal/fragment/nodes", handler.handleGetFragmentNodes).Methods("GET").Name("GetFragmentNodes")
	router.HandleFunc("/internal/index/{index}/attr/diff", handler.handlePostIndexAttrDiff).Methods("POST").Name("PostIndexAttrDiff")
	router.HandleFunc("/internal/index/{index}/field/{field}/attr/diff", handler.handlePostFieldAttrDiff).Methods("POST").Name("PostFieldAttrDiff")
	router.HandleFunc("/internal/index/{index}/field/{field}/remote-available-shards/{shardID}", handler.handleDeleteRemoteAvailableShard).Methods("DELETE")
	router.HandleFunc("/internal/nodes", handler.handleGetNodes).Methods("GET").Name("GetNodes")
	router.HandleFunc("/internal/shards/max", handler.handleGetShardsMax).Methods("GET").Name("GetShardsMax") // TODO: deprecate, but it's being used by the client
	router.HandleFunc("/internal/translate/data", handler.handleGetTranslateData).Methods("GET").Name("GetTranslateData")
	router.HandleFunc("/internal/translate/keys", handler.handlePostTranslateKeys).Methods("POST").Name("PostTranslateKeys")

	router.Use(handler.queryArgValidator)
	router.Use(handler.extractTracing)
	return router
}
896035
func NewRoute(method, path string, handler httputils.APIFunc) dkrouter.Route {
	return localRoute{method, path, handler}
}
1111846
func (c *Context) RoutesHandler(builder Builder) http.Handler {
	b := builder
	if b == nil {
		b = PassthroughBuilder
	}
	return NewRouter(c, b(NewOperationExecutor(c)))
}
208311
func NewRouter() *Router {
	return &Router{
		routes:     map[HTTPMethod]map[string]http.HandlerFunc{},
		regexps:    map[HTTPMethod]map[*regexp.Regexp]http.HandlerFunc{},
		subrouters: []*Router{},
	}
}
431614
func New() Router {
	return &router{
		mutex:  &sync.RWMutex{},
		routes: make(map[string]*match),
	}
}
1161489
func (c *CreateAppHandler) RegisterRoute(r *mux.Router) {
	r.Handle("/apps", c).Methods("POST")
}
850330
func newRouter() (r *router) {
	r = &router{
		trees: make(map[string]*node),
	}
	for _, m := range SupportMethods {
		r.trees[m] = &node{
			edges: edges{},
		}
	}
	return
}
145232
func NewRouteAppenderFactory(staticConfiguration static.Configuration, entryPointName string, acmeProvider *acme.Provider) *RouteAppenderFactory {
	return &RouteAppenderFactory{
		staticConfiguration: staticConfiguration,
		entryPointName:      entryPointName,
		acmeProvider:        acmeProvider,
	}
}