diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2017-11-22 07:56:46 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-11-22 20:53:15 +0000 |
commit | c344fe61c11beaf687da284f71bde2311b91371d (patch) | |
tree | d837a4c8ad0df01f15c7e90b052a72e1c39530ca /vendor/github.com/go-zoo/bone/bone.go | |
parent | ee4051db61ad8ce6f385ce5be45dcc4b0a29945d (diff) | |
download | podman-c344fe61c11beaf687da284f71bde2311b91371d.tar.gz podman-c344fe61c11beaf687da284f71bde2311b91371d.tar.bz2 podman-c344fe61c11beaf687da284f71bde2311b91371d.zip |
Update vendoring
Update version of docker to pull in lates code
Remove kubernetes since libpod is not tied to it.
Remove a few other packages that we don't seem to use.
Left in the networking stuff, since we will hopefully be wiring that together.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #60
Approved by: umohnani8
Diffstat (limited to 'vendor/github.com/go-zoo/bone/bone.go')
-rw-r--r-- | vendor/github.com/go-zoo/bone/bone.go | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/vendor/github.com/go-zoo/bone/bone.go b/vendor/github.com/go-zoo/bone/bone.go deleted file mode 100644 index d00a0b083..000000000 --- a/vendor/github.com/go-zoo/bone/bone.go +++ /dev/null @@ -1,74 +0,0 @@ -/******************************** -*** Multiplexer for Go *** -*** Bone is under MIT license *** -*** Code by CodingFerret *** -*** github.com/go-zoo *** -*********************************/ - -package bone - -import ( - "net/http" - "strings" -) - -// Mux have routes and a notFound handler -// Route: all the registred route -// notFound: 404 handler, default http.NotFound if not provided -type Mux struct { - Routes map[string][]*Route - prefix string - notFound http.Handler - Serve func(rw http.ResponseWriter, req *http.Request) - CaseSensitive bool -} - -var ( - static = "static" - method = []string{"GET", "POST", "PUT", "DELETE", "HEAD", "PATCH", "OPTIONS"} -) - -type adapter func(*Mux) *Mux - -// New create a pointer to a Mux instance -func New(adapters ...adapter) *Mux { - m := &Mux{Routes: make(map[string][]*Route), Serve: nil, CaseSensitive: true} - for _, adap := range adapters { - adap(m) - } - if m.Serve == nil { - m.Serve = m.DefaultServe - } - return m -} - -// Prefix set a default prefix for all routes registred on the router -func (m *Mux) Prefix(p string) *Mux { - m.prefix = strings.TrimSuffix(p, "/") - return m -} - -// DefaultServe is the default http request handler -func (m *Mux) DefaultServe(rw http.ResponseWriter, req *http.Request) { - // Check if a route match - if !m.parse(rw, req) { - // Check if it's a static ressource - if !m.staticRoute(rw, req) { - // Check if the request path doesn't end with / - if !m.validate(rw, req) { - // Check if same route exists for another HTTP method - if !m.otherMethods(rw, req) { - m.HandleNotFound(rw, req) - } - } - } - } -} - -// ServeHTTP pass the request to the serve method of Mux -func (m *Mux) ServeHTTP(rw http.ResponseWriter, req *http.Request) { - if !m.CaseSensitive { - req.URL.Path = strings.ToLower(req.URL.Path) - } - m.Serve(rw, req) -} |