diff options
author | Duco van Amstel <helcaraxan@gmail.com> | 2018-11-18 17:55:05 +0000 |
---|---|---|
committer | Wim <wim@42.be> | 2018-11-25 21:21:04 +0100 |
commit | 09875fe1603307080f3a4172985c5dca3bd9912d (patch) | |
tree | a23220772f6f6597d509ca71b2df3480a77b8076 /vendor/github.com/labstack/echo/router.go | |
parent | f716b8fc0ff90f47b61e218ef34019b38bd70e0d (diff) | |
download | matterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.tar.gz matterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.tar.bz2 matterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.zip |
Update direct dependencies where possible
Diffstat (limited to 'vendor/github.com/labstack/echo/router.go')
-rw-r--r-- | vendor/github.com/labstack/echo/router.go | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/vendor/github.com/labstack/echo/router.go b/vendor/github.com/labstack/echo/router.go index 3af4be0b..ff53da87 100644 --- a/vendor/github.com/labstack/echo/router.go +++ b/vendor/github.com/labstack/echo/router.go @@ -21,15 +21,16 @@ type ( kind uint8 children []*node methodHandler struct { - connect HandlerFunc - delete HandlerFunc - get HandlerFunc - head HandlerFunc - options HandlerFunc - patch HandlerFunc - post HandlerFunc - put HandlerFunc - trace HandlerFunc + connect HandlerFunc + delete HandlerFunc + get HandlerFunc + head HandlerFunc + options HandlerFunc + patch HandlerFunc + post HandlerFunc + propfind HandlerFunc + put HandlerFunc + trace HandlerFunc } ) @@ -59,8 +60,8 @@ func (r *Router) Add(method, path string, h HandlerFunc) { if path[0] != '/' { path = "/" + path } - ppath := path // Pristine path pnames := []string{} // Param names + ppath := path // Pristine path for i, l := 0, len(path); i < l; i++ { if path[i] == ':' { @@ -225,22 +226,24 @@ func (n *node) findChildByKind(t kind) *node { func (n *node) addHandler(method string, h HandlerFunc) { switch method { + case CONNECT: + n.methodHandler.connect = h + case DELETE: + n.methodHandler.delete = h case GET: n.methodHandler.get = h + case HEAD: + n.methodHandler.head = h + case OPTIONS: + n.methodHandler.options = h + case PATCH: + n.methodHandler.patch = h case POST: n.methodHandler.post = h + case PROPFIND: + n.methodHandler.propfind = h case PUT: n.methodHandler.put = h - case DELETE: - n.methodHandler.delete = h - case PATCH: - n.methodHandler.patch = h - case OPTIONS: - n.methodHandler.options = h - case HEAD: - n.methodHandler.head = h - case CONNECT: - n.methodHandler.connect = h case TRACE: n.methodHandler.trace = h } @@ -248,22 +251,24 @@ func (n *node) addHandler(method string, h HandlerFunc) { func (n *node) findHandler(method string) HandlerFunc { switch method { + case CONNECT: + return n.methodHandler.connect + case DELETE: + return n.methodHandler.delete case GET: return n.methodHandler.get + case HEAD: + return n.methodHandler.head + case OPTIONS: + return n.methodHandler.options + case PATCH: + return n.methodHandler.patch case POST: return n.methodHandler.post + case PROPFIND: + return n.methodHandler.propfind case PUT: return n.methodHandler.put - case DELETE: - return n.methodHandler.delete - case PATCH: - return n.methodHandler.patch - case OPTIONS: - return n.methodHandler.options - case HEAD: - return n.methodHandler.head - case CONNECT: - return n.methodHandler.connect case TRACE: return n.methodHandler.trace default: |