// InstallHandlers installs PubSub related HTTP handlers.
189374
func InstallHandlers(r *router.Router, base router.MiddlewareChain) {
	if appengine.IsDevAppServer() {
		r.GET(pubSubPullURLPath, base, pubSubPull)
	}
	r.POST(pubSubPushURLPath, base, pubSubPush)
}
316341
func InstallHandlers(r *router.Router, base router.MiddlewareChain) {
	r.POST(handlerPattern, base.Extend(gaemiddleware.RequireTaskQueue("")), TaskQueueHandler)
	r.POST("/_ah/push-handlers/"+notifyTopicSuffix, base, PubsubReceiver)
}
1005489
func (s *Service) InstallCommands() ([]string, error) {
	conf, err := s.render()
	if err != nil {
		return nil, err
	}
	cmd := fmt.Sprintf("cat > %s << 'EOF'\n%sEOF\n", s.confPath(), conf)
	return []string{cmd}, nil
}
820266
func (r *Registry) applyHandlers(f func(o RegisterObject)) {
	r.m.Lock()
	handlers := make([]RegisterObject, 0, len(r.handlers))
	for _, handler := range r.handlers {
		handlers = append(handlers, handler)
	}
	r.m.Unlock()

	for i := range handlers {
		f(handlers[i])
	}
}
1056726
func InstallHandlers(r *router.Router, base router.MiddlewareChain) {
	r.GET(
		"/internal/cron/ts_mon/housekeeping",
		base.Extend(gaemiddleware.RequireCron),
		housekeepingHandler)
}
531591
func NewSetupHandler() *SetupHandler {
	h := &SetupHandler{
		Router: NewRouter(),
		Logger: zap.NewNop(),
	}
	h.HandlerFunc("POST", setupPath, h.handlePostSetup)
	h.HandlerFunc("GET", setupPath, h.isOnboarding)
	return h
}
482369
func registerHandlers() {
	disabled := make(map[string]bool)
	if conf.Disable != "" {
		for _, endpoint := range strings.Split(conf.Disable, ",") {
			disabled[endpoint] = true
		}
	}

	for path, getHandler := range endpoints {
		log.Debugf("getHandler for %s", path)

		if _, ok := disabled[path]; ok {
			log.Infof("endpoint '%s' is explicitly disabled", path)
		} else if handler, err := getHandler(); err != nil {
			log.Warningf("endpoint '%s' is disabled: %v", path, err)
		} else {
			if path, handler, err = wrapHandler(path, handler, err); err != nil {
				log.Warningf("endpoint '%s' is disabled by wrapper: %v", path, err)
			} else {
				log.Infof("endpoint '%s' is enabled", path)
				http.Handle(path, handler)
			}
		}
	}
	log.Info("Handler set up complete.")
}
1248212
func (d *DockerMonitor) addHandler(event Event, handler EventHandler) {
	d.handlers[event] = handler
}
281801
func InstallHandlers(r *router.Router, base router.MiddlewareChain) {
	r.GET("/_ah/warmup", base, httpHandler)
	r.GET("/_ah/start", base, httpHandler)
}
797507
func (c *CniMonitor) SetupHandlers(m *config.ProcessorConfig) {

	c.proc.config = m
}
749099
func InstallHandlers(r *router.Router, mw router.MiddlewareChain) {
	dsp := &tq.Dispatcher{}
	registerTasks(dsp)
	mw = mw.Extend(func(c *router.Context, next router.Handler) {
		c.Context, _ = context.WithTimeout(c.Context, 30*time.Second)
		c.Context = withDispatcher(c.Context, dsp)
		c.Context = withConfig(c.Context, &rpc.Config{})
		c.Context = withCompute(c.Context, newCompute(c.Context))
		c.Context = withSwarming(c.Context, newSwarming(c.Context))
		next(c)
	})
	dsp.InstallRoutes(r, mw)
	r.GET("/internal/cron/count-vms", mw, newHTTPHandler(countVMsAsync))
	r.GET("/internal/cron/create-instances", mw, newHTTPHandler(createInstancesAsync))
	r.GET("/internal/cron/drain-vms", mw, newHTTPHandler(drainVMsAsync))
	r.GET("/internal/cron/expand-configs", mw, newHTTPHandler(expandConfigsAsync))
	r.GET("/internal/cron/manage-bots", mw, newHTTPHandler(manageBotsAsync))
	r.GET("/internal/cron/report-quota", mw, newHTTPHandler(reportQuotasAsync))
}
968
func PubSubHandler(ctx *router.Context) {
	statusCode := pubSubHandlerImpl(ctx.Context, ctx.Request)
	ctx.Writer.WriteHeader(statusCode)
}
571286
func InstallHandlers(r *router.Router, base router.MiddlewareChain) {
	// Pprof native routing structure is not supported by julienschmidt/httprouter
	// since it mixes prefix matches and direct matches. So we'll have to do some
	// manual routing for paths under /debug/pprof :(
	r.GET("/debug/pprof/*path", base, func(c *router.Context) {
		// Validate the token generated through the portal page.
		tok := c.Request.FormValue("tok")
		if tok == "" {
			sendError(c.Writer, "Missing 'tok' query parameter with a pprof token", http.StatusBadRequest)
			return
		}
		switch err := checkToken(c.Context, tok); {
		case transient.Tag.In(err):
			sendError(c.Writer, fmt.Sprintf("Transient error, please retry: %s", err), http.StatusInternalServerError)
			return
		case err != nil:
			sendError(c.Writer, fmt.Sprintf("Bad pprof token: %s", err), http.StatusBadRequest)
			return
		}

		// Manually route. See init() in go/src/net/http/pprof/pprof.go.
		h := pprofRoutes[c.Params.ByName("path")]
		if h == nil {
			h = internal.Index
		}
		h(c.Writer, c.Request)
	})
}
898627
func (e *Environment) InstallHandlersWithMiddleware(r *router.Router, base router.MiddlewareChain) {
	warmup.InstallHandlers(r, base)

	if e.ExtraHandlers != nil {
		e.ExtraHandlers(r, base)
	}
}
99226
func DefaultHandlers() Handlers {
	return Handlers{
		Build:            NewHandlerList(JSONBuilder),
		Sign:             NewHandlerList(),
		Send:             NewHandlerList(WithTracing(BaseSender)),
		ValidateResponse: NewHandlerList(),
		Decode:           NewHandlerList(JSONDecoder),
		DecodeError:      NewHandlerList(),
		Complete:         NewHandlerList(),
	}
}
558948
func AddHandlers(p kprinters.PrintHandler) {
	p.Handler(buildColumns, nil, printBuild)
	p.Handler(buildColumns, nil, printBuildList)
	p.Handler(buildConfigColumns, nil, printBuildConfig)
	p.Handler(buildConfigColumns, nil, printBuildConfigList)
	p.Handler(policyRuleColumns, nil, printSubjectRulesReview)
	p.Handler(policyRuleColumns, nil, printSelfSubjectRulesReview)
	p.Handler(imageColumns, nil, printImage)
	p.Handler(imageStreamTagColumns, imageStreamTagWideColumns, printImageStreamTag)
	p.Handler(imageStreamTagColumns, imageStreamTagWideColumns, printImageStreamTagList)
	p.Handler(imageStreamImageColumns, imageStreamImageWideColumns, printImageStreamImage)
	p.Handler(imageColumns, nil, printImageList)
	p.Handler(imageStreamColumns, nil, printImageStream)
	p.Handler(imageStreamColumns, nil, printImageStreamList)
	p.Handler(projectColumns, nil, printProject)
	p.Handler(projectColumns, nil, printProjectList)
	p.Handler(routeColumns, nil, printRoute)
	p.Handler(routeColumns, nil, printRouteList)
	p.Handler(deploymentConfigColumns, nil, printDeploymentConfig)
	p.Handler(deploymentConfigColumns, nil, printDeploymentConfigList)
	p.Handler(templateColumns, nil, printTemplate)
	p.Handler(templateColumns, nil, printTemplateList)

	p.Handler(roleBindingColumns, nil, printRoleBinding)
	p.Handler(roleBindingColumns, nil, printRoleBindingList)
	p.Handler(roleColumns, nil, printRole)
	p.Handler(roleColumns, nil, printRoleList)

	p.Handler(roleColumns, nil, printClusterRole)
	p.Handler(roleColumns, nil, printClusterRoleList)
	p.Handler(roleBindingColumns, nil, printClusterRoleBinding)
	p.Handler(roleBindingColumns, nil, printClusterRoleBindingList)

	p.Handler(oauthClientColumns, nil, printOAuthClient)
	p.Handler(oauthClientColumns, nil, printOAuthClientList)
	p.Handler(oauthClientAuthorizationColumns, nil, printOAuthClientAuthorization)
	p.Handler(oauthClientAuthorizationColumns, nil, printOAuthClientAuthorizationList)
	p.Handler(oauthAccessTokenColumns, nil, printOAuthAccessToken)
	p.Handler(oauthAccessTokenColumns, nil, printOAuthAccessTokenList)
	p.Handler(oauthAuthorizeTokenColumns, nil, printOAuthAuthorizeToken)
	p.Handler(oauthAuthorizeTokenColumns, nil, printOAuthAuthorizeTokenList)

	p.Handler(userColumns, nil, printUser)
	p.Handler(userColumns, nil, printUserList)
	p.Handler(identityColumns, nil, printIdentity)
	p.Handler(identityColumns, nil, printIdentityList)
	p.Handler(userIdentityMappingColumns, nil, printUserIdentityMapping)
	p.Handler(groupColumns, nil, printGroup)
	p.Handler(groupColumns, nil, printGroupList)

	p.Handler(IsPersonalSubjectAccessReviewColumns, nil, printIsPersonalSubjectAccessReview)

	p.Handler(hostSubnetColumns, nil, printHostSubnet)
	p.Handler(hostSubnetColumns, nil, printHostSubnetList)
	p.Handler(netNamespaceColumns, nil, printNetNamespaceList)
	p.Handler(netNamespaceColumns, nil, printNetNamespace)
	p.Handler(clusterNetworkColumns, nil, printClusterNetwork)
	p.Handler(clusterNetworkColumns, nil, printClusterNetworkList)
	p.Handler(egressNetworkPolicyColumns, nil, printEgressNetworkPolicy)
	p.Handler(egressNetworkPolicyColumns, nil, printEgressNetworkPolicyList)

	p.Handler(clusterResourceQuotaColumns, nil, printClusterResourceQuota)
	p.Handler(clusterResourceQuotaColumns, nil, printClusterResourceQuotaList)
	p.Handler(clusterResourceQuotaColumns, nil, printAppliedClusterResourceQuota)
	p.Handler(clusterResourceQuotaColumns, nil, printAppliedClusterResourceQuotaList)

	p.Handler(roleBindingRestrictionColumns, nil, printRoleBindingRestriction)
	p.Handler(roleBindingRestrictionColumns, nil, printRoleBindingRestrictionList)

	p.Handler(templateInstanceColumns, nil, printTemplateInstance)
	p.Handler(templateInstanceColumns, nil, printTemplateInstanceList)
	p.Handler(brokerTemplateInstanceColumns, nil, printBrokerTemplateInstance)
	p.Handler(brokerTemplateInstanceColumns, nil, printBrokerTemplateInstanceList)

	p.Handler(securityContextConstraintsColumns, nil, printSecurityContextConstraints)
	p.Handler(securityContextConstraintsColumns, nil, printSecurityContextConstraintsList)
	p.Handler(rangeAllocationColumns, nil, printRangeAllocation)
	p.Handler(rangeAllocationColumns, nil, printRangeAllocationList)
}
496354
func InstallHandlers(r *router.Router, base router.MiddlewareChain) {
	m := CookieAuth.(cookieAuthMethod)
	if oid, ok := m.Method.(*openid.AuthMethod); ok {
		oid.InstallHandlers(r, base)
	}
	auth.InstallHandlers(r, base)
	authdbimpl.InstallHandlers(r, base)
}