summaryrefslogtreecommitdiff
path: root/vendor/github.com/emicklei/go-restful/curly_route.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-03-26 18:26:55 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-27 18:09:12 +0000
commitaf64e10400f8533a0c48ecdf5ab9b7fbf329e14e (patch)
tree59160e3841b440dd35189c724bbb4375a7be173b /vendor/github.com/emicklei/go-restful/curly_route.go
parent26d7e3c7b85e28c4e42998c90fdcc14079f13eef (diff)
downloadpodman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.tar.gz
podman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.tar.bz2
podman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.zip
Vendor in lots of kubernetes stuff to shrink image size
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #554 Approved by: mheon
Diffstat (limited to 'vendor/github.com/emicklei/go-restful/curly_route.go')
-rw-r--r--vendor/github.com/emicklei/go-restful/curly_route.go52
1 files changed, 0 insertions, 52 deletions
diff --git a/vendor/github.com/emicklei/go-restful/curly_route.go b/vendor/github.com/emicklei/go-restful/curly_route.go
deleted file mode 100644
index 296f94650..000000000
--- a/vendor/github.com/emicklei/go-restful/curly_route.go
+++ /dev/null
@@ -1,52 +0,0 @@
-package restful
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-// curlyRoute exits for sorting Routes by the CurlyRouter based on number of parameters and number of static path elements.
-type curlyRoute struct {
- route Route
- paramCount int
- staticCount int
-}
-
-type sortableCurlyRoutes []curlyRoute
-
-func (s *sortableCurlyRoutes) add(route curlyRoute) {
- *s = append(*s, route)
-}
-
-func (s sortableCurlyRoutes) routes() (routes []Route) {
- for _, each := range s {
- routes = append(routes, each.route) // TODO change return type
- }
- return routes
-}
-
-func (s sortableCurlyRoutes) Len() int {
- return len(s)
-}
-func (s sortableCurlyRoutes) Swap(i, j int) {
- s[i], s[j] = s[j], s[i]
-}
-func (s sortableCurlyRoutes) Less(i, j int) bool {
- ci := s[i]
- cj := s[j]
-
- // primary key
- if ci.staticCount < cj.staticCount {
- return true
- }
- if ci.staticCount > cj.staticCount {
- return false
- }
- // secundary key
- if ci.paramCount < cj.paramCount {
- return true
- }
- if ci.paramCount > cj.paramCount {
- return false
- }
- return ci.route.Path < cj.route.Path
-}