// AddRoutes sets up routes for the provided objects.
964758
func AddRoutes(objects Objects) Objects {
	routes := []runtime.Object{}
	for _, o := range objects {
		switch t := o.(type) {
		case *kapi.Service:
			routes = append(routes, &routeapi.Route{
				ObjectMeta: metav1.ObjectMeta{
					Name:   t.Name,
					Labels: t.Labels,
				},
				Spec: routeapi.RouteSpec{
					To: routeapi.RouteTargetReference{
						Name: t.Name,
					},
				},
			})
		}
	}
	return append(objects, routes...)
}
1245903
func (r *Router) AddRouteTLS(sniHost string, target Handler, config *tls.Config) {
	r.AddRoute(sniHost, &TLSHandler{
		Next:   target,
		Config: config,
	})
}
917424
func (r *router) addnodes(method string, nodes []*node) {
	cn := r.trees[method]
	var p = cn
	for i := 0; i < len(nodes); i++ {
		p = r.addnode(p, nodes, i)
	}
}
682466
func (e *Echo) Add(method, path string, handler HandlerFunc, middleware ...MiddlewareFunc) *Route {
	return e.add("", method, path, handler, middleware...)
}
507041
func (b *BigIP) AddRoute(config *Route) error {
	return b.post(config, uriNet, uriRoute)
}
1124828
func UpdateRoutes(newRoutes []Route) error {
	for i := range newRoutes {
		if newRoutes[i].ExpectedCode == 0 {
			newRoutes[i].ExpectedCode = 200
		}
		if newRoutes[i].Timeout == 0 {
			newRoutes[i].Timeout = 3000
		}
		if newRoutes[i].Attempts == 0 {
			newRoutes[i].Attempts = 3
		}
		for _, tgt := range newRoutes[i].Targets {
			prox := &proxy{targetUrl: tgt, fwdPath: newRoutes[i].FwdPath, prefixPath: newRoutes[i].Path}
			err := prox.initProxy()
			if err == nil {
				newRoutes[i].proxies = append(newRoutes[i].proxies, prox)
			} else {
				lumber.Error("[NANOBOX-ROUTER] Failed to update routes - %v", err)
				return err
			}
		}
	}

	routesMutex.Lock()
	routes = newRoutes
	routesMutex.Unlock()
	lumber.Trace("[NANOBOX-ROUTER] Routes updated")
	return nil
}
904808
func (r *Router) AddRoute(rule string, priority int, handler http.Handler) error {
	parse, err := r.parser.Parse(rule)
	if err != nil {
		return fmt.Errorf("error while parsing rule %s: %v", rule, err)
	}

	buildTree, ok := parse.(treeBuilder)
	if !ok {
		return fmt.Errorf("error while parsing rule %s", rule)
	}

	if priority == 0 {
		priority = len(rule)
	}

	route := r.NewRoute().Handler(handler).Priority(priority)
	return addRuleOnRoute(route, buildTree())
}
628765
func (s *AddIpRoutesInput) SetIpRoutes(v []*IpRoute) *AddIpRoutesInput {
	s.IpRoutes = v
	return s
}
945609
func (this *Router) AddRoute(verb string, path string, funcs ...func(*Request, *Response, func())) {

	route := &Route{
		Method:        strings.ToUpper(verb),
		Path:          path,
		Callbacks:     funcs,
		CaseSensitive: this.CaseSensitive,
		Strict:        this.Strict,
	}

	this.Routes = append(this.Routes, route)
}
461162
func (r *Route) stringRoutes(routes *[]string) {

	var thisRoute string

	// handle root node
	if r.fullPath == "" {
		thisRoute = "/"
	} else {
		thisRoute = r.fullPath
	}

	if len(r.handlers) > 0 {
		thisRoute = thisRoute + "\t["
		methods := make([]string, 0, 8)
		for method := range r.handlers {
			methods = append(methods, method)
		}
		thisRoute = thisRoute + strings.Join(methods, ", ") + "]"
		*routes = append(*routes, thisRoute)
	}

	// recursion
	for _, child := range r.getChildren() {
		child.stringRoutes(routes)
	}
}
1350410
func (s *ingressRouteLister) IngressRoutes(namespace string) IngressRouteNamespaceLister {
	return ingressRouteNamespaceLister{indexer: s.indexer, namespace: namespace}
}
546564
func SetRoutes(router *gin.Engine) {
	if EnableRestAPI {
		route.RestV1SetRoutes(router)
	}
	if EnableStreamAPI {
		route.StreamV1SetRoutes(router)
	}
}
548888
func (e *Echo) Routes() []*Route {
	routes := make([]*Route, 0, len(e.router.routes))
	for _, v := range e.router.routes {
		routes = append(routes, v)
	}
	return routes
}
1076471
func (s *UpdateStageInput) SetRouteSettings(v map[string]*RouteSettings) *UpdateStageInput {
	s.RouteSettings = v
	return s
}
1215178
func (r *router) initRoutes() {
	r.routes = []dkrouter.Route{
		// OPTIONS
		// GET
		// /images/json in docker
		NewGetRoute("/images/get", r.getImagesJSON),
		// /images/get in docker
		NewGetRoute("/images/save", r.getImagesSave),
		// POST
		NewPostRoute("/image/create", r.postImagesCreate),
		NewPostRoute("/image/load", r.postImagesLoad),
		NewPostRoute("/image/push", r.postImagesPush),
		// DELETE
		NewDeleteRoute("/image", r.deleteImages),
	}
}
429404
func (r *imageRouter) initRoutes() {
	r.routes = []router.Route{
		// GET
		router.NewGetRoute("/images/json", r.getImagesJSON),
		router.NewGetRoute("/images/search", r.getImagesSearch),
		router.NewGetRoute("/images/get", r.getImagesGet),
		router.NewGetRoute("/images/{name:.*}/get", r.getImagesGet),
		router.NewGetRoute("/images/{name:.*}/history", r.getImagesHistory),
		router.NewGetRoute("/images/{name:.*}/json", r.getImagesByName),
		// POST
		router.NewPostRoute("/images/load", r.postImagesLoad),
		router.NewPostRoute("/images/create", r.postImagesCreate),
		router.NewPostRoute("/images/{name:.*}/push", r.postImagesPush),
		router.NewPostRoute("/images/{name:.*}/tag", r.postImagesTag),
		router.NewPostRoute("/images/prune", r.postImagesPrune),
		// DELETE
		router.NewDeleteRoute("/images/{name:.*}", r.deleteImages),
	}
}
795924
func (service *BaseService) AddMethods(names []string, obj interface{}, aliases []string, option ...Options) Service {
	service.methodManager.AddMethods(names, obj, aliases, option...)
	return service
}