aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2016-05-12 13:28:05 +0000
committerFelix Hanley <felix@userspace.com.au>2016-05-12 13:28:05 +0000
commite1c3d6f7db06d592538f1162b2b6b9f1b6efa330 (patch)
treec26ee9ad763a2bc48cde0e2c46f831a40f55ed28 /src
parentbb8476ffe78210d1a4c0b4bbee6da99da1bc15c5 (diff)
downloadgo-dict2rest-e1c3d6f7db06d592538f1162b2b6b9f1b6efa330.tar.gz
go-dict2rest-e1c3d6f7db06d592538f1162b2b6b9f1b6efa330.tar.bz2
Shuffle vendor directory up a level o_0
Diffstat (limited to 'src')
-rw-r--r--src/vendor/github.com/alexedwards/stack/.travis.yml8
-rw-r--r--src/vendor/github.com/alexedwards/stack/LICENSE20
-rw-r--r--src/vendor/github.com/alexedwards/stack/README.md187
-rw-r--r--src/vendor/github.com/alexedwards/stack/context.go55
-rw-r--r--src/vendor/github.com/alexedwards/stack/context_test.go48
-rw-r--r--src/vendor/github.com/alexedwards/stack/stack.go94
-rw-r--r--src/vendor/github.com/alexedwards/stack/stack_test.go126
-rw-r--r--src/vendor/github.com/julienschmidt/httprouter/.travis.yml (renamed from src/dict2rest/vendor/github.com/julienschmidt/httprouter/.travis.yml)0
-rw-r--r--src/vendor/github.com/julienschmidt/httprouter/LICENSE (renamed from src/dict2rest/vendor/github.com/julienschmidt/httprouter/LICENSE)0
-rw-r--r--src/vendor/github.com/julienschmidt/httprouter/README.md (renamed from src/dict2rest/vendor/github.com/julienschmidt/httprouter/README.md)0
-rw-r--r--src/vendor/github.com/julienschmidt/httprouter/path.go (renamed from src/dict2rest/vendor/github.com/julienschmidt/httprouter/path.go)0
-rw-r--r--src/vendor/github.com/julienschmidt/httprouter/path_test.go (renamed from src/dict2rest/vendor/github.com/julienschmidt/httprouter/path_test.go)0
-rw-r--r--src/vendor/github.com/julienschmidt/httprouter/router.go (renamed from src/dict2rest/vendor/github.com/julienschmidt/httprouter/router.go)0
-rw-r--r--src/vendor/github.com/julienschmidt/httprouter/router_test.go (renamed from src/dict2rest/vendor/github.com/julienschmidt/httprouter/router_test.go)0
-rw-r--r--src/vendor/github.com/julienschmidt/httprouter/tree.go (renamed from src/dict2rest/vendor/github.com/julienschmidt/httprouter/tree.go)0
-rw-r--r--src/vendor/github.com/julienschmidt/httprouter/tree_test.go (renamed from src/dict2rest/vendor/github.com/julienschmidt/httprouter/tree_test.go)0
-rw-r--r--src/vendor/github.com/justinas/alice/.travis.yml (renamed from src/dict2rest/vendor/github.com/justinas/alice/.travis.yml)0
-rw-r--r--src/vendor/github.com/justinas/alice/LICENSE (renamed from src/dict2rest/vendor/github.com/justinas/alice/LICENSE)0
-rw-r--r--src/vendor/github.com/justinas/alice/README.md (renamed from src/dict2rest/vendor/github.com/justinas/alice/README.md)0
-rw-r--r--src/vendor/github.com/justinas/alice/chain.go (renamed from src/dict2rest/vendor/github.com/justinas/alice/chain.go)0
-rw-r--r--src/vendor/github.com/justinas/alice/chain_test.go (renamed from src/dict2rest/vendor/github.com/justinas/alice/chain_test.go)0
-rw-r--r--src/vendor/github.com/rs/cors/.travis.yml (renamed from src/dict2rest/vendor/github.com/rs/cors/.travis.yml)0
-rw-r--r--src/vendor/github.com/rs/cors/LICENSE (renamed from src/dict2rest/vendor/github.com/rs/cors/LICENSE)0
-rw-r--r--src/vendor/github.com/rs/cors/README.md (renamed from src/dict2rest/vendor/github.com/rs/cors/README.md)0
-rw-r--r--src/vendor/github.com/rs/cors/bench_test.go (renamed from src/dict2rest/vendor/github.com/rs/cors/bench_test.go)0
-rw-r--r--src/vendor/github.com/rs/cors/cors.go (renamed from src/dict2rest/vendor/github.com/rs/cors/cors.go)0
-rw-r--r--src/vendor/github.com/rs/cors/cors_test.go (renamed from src/dict2rest/vendor/github.com/rs/cors/cors_test.go)0
-rw-r--r--src/vendor/github.com/rs/cors/examples/alice/server.go (renamed from src/dict2rest/vendor/github.com/rs/cors/examples/alice/server.go)0
-rw-r--r--src/vendor/github.com/rs/cors/examples/default/server.go (renamed from src/dict2rest/vendor/github.com/rs/cors/examples/default/server.go)0
-rw-r--r--src/vendor/github.com/rs/cors/examples/goji/server.go (renamed from src/dict2rest/vendor/github.com/rs/cors/examples/goji/server.go)0
-rw-r--r--src/vendor/github.com/rs/cors/examples/martini/server.go (renamed from src/dict2rest/vendor/github.com/rs/cors/examples/martini/server.go)0
-rw-r--r--src/vendor/github.com/rs/cors/examples/negroni/server.go (renamed from src/dict2rest/vendor/github.com/rs/cors/examples/negroni/server.go)0
-rw-r--r--src/vendor/github.com/rs/cors/examples/nethttp/server.go (renamed from src/dict2rest/vendor/github.com/rs/cors/examples/nethttp/server.go)0
-rw-r--r--src/vendor/github.com/rs/cors/examples/openbar/server.go (renamed from src/dict2rest/vendor/github.com/rs/cors/examples/openbar/server.go)0
-rw-r--r--src/vendor/github.com/rs/cors/examples/xhandler/server.go (renamed from src/dict2rest/vendor/github.com/rs/cors/examples/xhandler/server.go)0
-rw-r--r--src/vendor/github.com/rs/cors/utils.go (renamed from src/dict2rest/vendor/github.com/rs/cors/utils.go)0
-rw-r--r--src/vendor/github.com/rs/cors/utils_test.go (renamed from src/dict2rest/vendor/github.com/rs/cors/utils_test.go)0
-rw-r--r--src/vendor/github.com/rs/xhandler/.travis.yml (renamed from src/dict2rest/vendor/github.com/rs/xhandler/.travis.yml)0
-rw-r--r--src/vendor/github.com/rs/xhandler/LICENSE (renamed from src/dict2rest/vendor/github.com/rs/xhandler/LICENSE)0
-rw-r--r--src/vendor/github.com/rs/xhandler/README.md (renamed from src/dict2rest/vendor/github.com/rs/xhandler/README.md)0
-rw-r--r--src/vendor/github.com/rs/xhandler/chain.go (renamed from src/dict2rest/vendor/github.com/rs/xhandler/chain.go)0
-rw-r--r--src/vendor/github.com/rs/xhandler/chain_example_test.go (renamed from src/dict2rest/vendor/github.com/rs/xhandler/chain_example_test.go)0
-rw-r--r--src/vendor/github.com/rs/xhandler/chain_test.go (renamed from src/dict2rest/vendor/github.com/rs/xhandler/chain_test.go)0
-rw-r--r--src/vendor/github.com/rs/xhandler/middleware.go (renamed from src/dict2rest/vendor/github.com/rs/xhandler/middleware.go)0
-rw-r--r--src/vendor/github.com/rs/xhandler/middleware_test.go (renamed from src/dict2rest/vendor/github.com/rs/xhandler/middleware_test.go)0
-rw-r--r--src/vendor/github.com/rs/xhandler/xhandler.go (renamed from src/dict2rest/vendor/github.com/rs/xhandler/xhandler.go)0
-rw-r--r--src/vendor/github.com/rs/xhandler/xhandler_example_test.go (renamed from src/dict2rest/vendor/github.com/rs/xhandler/xhandler_example_test.go)0
-rw-r--r--src/vendor/github.com/rs/xhandler/xhandler_test.go (renamed from src/dict2rest/vendor/github.com/rs/xhandler/xhandler_test.go)0
-rw-r--r--src/vendor/github.com/rs/xhandler/xmux/README.md (renamed from src/dict2rest/vendor/github.com/rs/xhandler/xmux/README.md)0
-rw-r--r--src/vendor/github.com/stretchr/graceful/.gitignore (renamed from src/dict2rest/vendor/github.com/stretchr/graceful/.gitignore)0
-rw-r--r--src/vendor/github.com/stretchr/graceful/LICENSE (renamed from src/dict2rest/vendor/github.com/stretchr/graceful/LICENSE)0
-rw-r--r--src/vendor/github.com/stretchr/graceful/README.md (renamed from src/dict2rest/vendor/github.com/stretchr/graceful/README.md)0
-rw-r--r--src/vendor/github.com/stretchr/graceful/graceful.go (renamed from src/dict2rest/vendor/github.com/stretchr/graceful/graceful.go)0
-rw-r--r--src/vendor/github.com/stretchr/graceful/graceful_test.go (renamed from src/dict2rest/vendor/github.com/stretchr/graceful/graceful_test.go)0
-rw-r--r--src/vendor/github.com/stretchr/graceful/tests/main.go (renamed from src/dict2rest/vendor/github.com/stretchr/graceful/tests/main.go)0
-rw-r--r--src/vendor/golang.org/x/net/context/context.go (renamed from src/dict2rest/vendor/golang.org/x/net/context/context.go)0
-rw-r--r--src/vendor/golang.org/x/net/context/context_test.go (renamed from src/dict2rest/vendor/golang.org/x/net/context/context_test.go)0
-rw-r--r--src/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go (renamed from src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go)0
-rw-r--r--src/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go (renamed from src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go)0
-rw-r--r--src/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go (renamed from src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go)0
-rw-r--r--src/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go (renamed from src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go)0
-rw-r--r--src/vendor/golang.org/x/net/context/withtimeout_test.go (renamed from src/dict2rest/vendor/golang.org/x/net/context/withtimeout_test.go)0
-rw-r--r--src/vendor/golang.org/x/net/dict/dict.go (renamed from src/dict2rest/vendor/golang.org/x/net/dict/dict.go)0
-rw-r--r--src/vendor/golang.org/x/net/netutil/listen.go (renamed from src/dict2rest/vendor/golang.org/x/net/netutil/listen.go)0
-rw-r--r--src/vendor/golang.org/x/net/netutil/listen_test.go (renamed from src/dict2rest/vendor/golang.org/x/net/netutil/listen_test.go)0
65 files changed, 538 insertions, 0 deletions
diff --git a/src/vendor/github.com/alexedwards/stack/.travis.yml b/src/vendor/github.com/alexedwards/stack/.travis.yml
new file mode 100644
index 0000000..70eed36
--- /dev/null
+++ b/src/vendor/github.com/alexedwards/stack/.travis.yml
@@ -0,0 +1,8 @@
+sudo: false
+language: go
+go:
+ - 1.1
+ - 1.2
+ - 1.3
+ - 1.4
+ - tip \ No newline at end of file
diff --git a/src/vendor/github.com/alexedwards/stack/LICENSE b/src/vendor/github.com/alexedwards/stack/LICENSE
new file mode 100644
index 0000000..f25a33b
--- /dev/null
+++ b/src/vendor/github.com/alexedwards/stack/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Alex Edwards
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/vendor/github.com/alexedwards/stack/README.md b/src/vendor/github.com/alexedwards/stack/README.md
new file mode 100644
index 0000000..ba689f6
--- /dev/null
+++ b/src/vendor/github.com/alexedwards/stack/README.md
@@ -0,0 +1,187 @@
+# Stack <br> [![Build Status](https://travis-ci.org/alexedwards/stack.svg?branch=master)](https://travis-ci.org/alexedwards/stack) [![Coverage](http://gocover.io/_badge/github.com/alexedwards/stack?0)](http://gocover.io/github.com/alexedwards/stack) [![GoDoc](http://godoc.org/github.com/alexedwards/stack?status.png)](http://godoc.org/github.com/alexedwards/stack)
+
+Stack provides an easy way to chain your HTTP middleware and handlers together and to pass request-scoped context between them. It's essentially a context-aware version of [Alice](https://github.com/justinas/alice).
+
+[Skip to the example &rsaquo;](#example)
+
+### Usage
+
+#### Making a chain
+
+Middleware chains are constructed with [`stack.New()`](http://godoc.org/github.com/alexedwards/stack#New):
+
+```go
+stack.New(middlewareOne, middlewareTwo, middlewareThree)
+```
+
+You can also store middleware chains as variables, and then [`Append()`](http://godoc.org/github.com/alexedwards/stack#Chain.Append) to them:
+
+```go
+stdStack := stack.New(middlewareOne, middlewareTwo)
+extStack := stdStack.Append(middlewareThree, middlewareFour)
+```
+
+Your middleware should have the signature `func(*stack.Context, http.Handler) http.Handler`. For example:
+
+```go
+func middlewareOne(ctx *stack.Context, next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ // do something middleware-ish, accessing ctx
+ next.ServeHTTP(w, r)
+ })
+}
+```
+
+You can also use middleware with the signature `func(http.Handler) http.Handler` by adapting it with [`stack.Adapt()`](http://godoc.org/github.com/alexedwards/stack#Adapt). For example, if you had the middleware:
+
+```go
+func middlewareTwo(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ // do something else middleware-ish
+ next.ServeHTTP(w, r)
+ })
+}
+```
+
+You can add it to a chain like this:
+
+```go
+stack.New(middlewareOne, stack.Adapt(middlewareTwo), middlewareThree)
+```
+
+See the [codes samples](#code-samples) for real-life use of third-party middleware with Stack.
+
+#### Adding an application handler
+
+Application handlers should have the signature `func(*stack.Context, http.ResponseWriter, *http.Request)`. You add them to the end of a middleware chain with the [`Then()`](http://godoc.org/github.com/alexedwards/stack#Chain.Then) method.
+
+So an application handler like this:
+
+```go
+func appHandler(ctx *stack.Context, w http.ResponseWriter, r *http.Request) {
+ // do something handler-ish, accessing ctx
+}
+```
+
+Is added to the end of a middleware chain like this:
+
+```go
+stack.New(middlewareOne, middlewareTwo).Then(appHandler)
+```
+
+For convenience [`ThenHandler()`](http://godoc.org/github.com/alexedwards/stack#Chain.ThenHandler) and [`ThenHandlerFunc()`](http://godoc.org/github.com/alexedwards/stack#Chain.ThenHandlerFunc) methods are also provided. These allow you to finish a chain with a standard `http.Handler` or `http.HandlerFunc` respectively.
+
+For example, you could use a standard `http.FileServer` as the application handler:
+
+```go
+fs := http.FileServer(http.Dir("./static/"))
+http.Handle("/", stack.New(middlewareOne, middlewareTwo).ThenHandler(fs))
+```
+
+Once a chain is 'closed' with any of these methods it is converted into a [`HandlerChain`](http://godoc.org/github.com/alexedwards/stack#HandlerChain) object which satisfies the `http.Handler` interface, and can be used with the `http.DefaultServeMux` and many other routers.
+
+#### Using context
+
+Request-scoped data (or *context*) can be passed through the chain by storing it in `stack.Context`. This is implemented as a pointer to a `map[string]interface{}` and scoped to the goroutine executing the current HTTP request. Operations on `stack.Context` are protected by a mutex, so if you need to pass the context pointer to another goroutine (say for logging or completing a background process) it is safe for concurrent use.
+
+Data is added with [`Context.Put()`](http://godoc.org/github.com/alexedwards/stack#Context.Put). The first parameter is a string (which acts as a key) and the second is the value you need to store. For example:
+
+```go
+func middlewareOne(ctx *stack.Context, next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ ctx.Put("token", "c9e452805dee5044ba520198628abcaa")
+ next.ServeHTTP(w, r)
+ })
+}
+```
+
+You retrieve data with [`Context.Get()`](http://godoc.org/github.com/alexedwards/stack#Context.Get). Remember to type assert the returned value into the type you're expecting.
+
+```go
+func appHandler(ctx *stack.Context, w http.ResponseWriter, r *http.Request) {
+ token, ok := ctx.Get("token").(string)
+ if !ok {
+ http.Error(w, http.StatusText(500), 500)
+ return
+ }
+ fmt.Fprintf(w, "Token is: %s", token)
+}
+```
+
+Note that `Context.Get()` will return `nil` if a key does not exist. If you need to tell the difference between a key having a `nil` value and it explicitly not existing, please check with [`Context.Exists()`](http://godoc.org/github.com/alexedwards/stack#Context.Exists).
+
+Keys (and their values) can be deleted with [`Context.Delete()`](http://godoc.org/github.com/alexedwards/stack#Context.Delete).
+
+#### Injecting context
+
+It's possible to inject values into `stack.Context` during a request cycle but *before* the chain starts to be executed. This is useful if you need to inject parameters from a router into the context.
+
+The [`Inject()`](http://godoc.org/github.com/alexedwards/stack#Inject) function returns a new copy of the chain containing the injected context. You should make sure that you use this new copy &ndash; not the original &ndash; for subsequent processing.
+
+Here's an example of a wrapper for injecting [httprouter](https://github.com/julienschmidt/httprouter) params into the context:
+
+```go
+func InjectParams(hc stack.HandlerChain) httprouter.Handle {
+ return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
+ newHandlerChain := stack.Inject(hc, "params", ps)
+ newHandlerChain.ServeHTTP(w, r)
+ }
+}
+```
+
+A full example is available in the [code samples](#code-samples).
+
+### Example
+
+```go
+package main
+
+import (
+ "net/http"
+ "github.com/alexedwards/stack"
+ "fmt"
+)
+
+func main() {
+ stk := stack.New(token, stack.Adapt(language))
+
+ http.Handle("/", stk.Then(final))
+
+ http.ListenAndServe(":3000", nil)
+}
+
+func token(ctx *stack.Context, next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ ctx.Put("token", "c9e452805dee5044ba520198628abcaa")
+ next.ServeHTTP(w, r)
+ })
+}
+
+func language(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Language", "en-gb")
+ next.ServeHTTP(w, r)
+ })
+}
+
+func final(ctx *stack.Context, w http.ResponseWriter, r *http.Request) {
+ token, ok := ctx.Get("token").(string)
+ if !ok {
+ http.Error(w, http.StatusText(500), 500)
+ return
+ }
+ fmt.Fprintf(w, "Token is: %s", token)
+}
+```
+
+### Code samples
+
+* [Integrating with httprouter](https://gist.github.com/alexedwards/4d20c505f389597c3360)
+* *More to follow*
+
+### TODO
+
+- Add more code samples (using 3rd party middleware)
+- Make a `chain.Merge()` method
+- Mirror master in v1 branch (and mention gopkg.in in README)
+- Add benchmarks
diff --git a/src/vendor/github.com/alexedwards/stack/context.go b/src/vendor/github.com/alexedwards/stack/context.go
new file mode 100644
index 0000000..07afe21
--- /dev/null
+++ b/src/vendor/github.com/alexedwards/stack/context.go
@@ -0,0 +1,55 @@
+package stack
+
+import (
+ "sync"
+)
+
+type Context struct {
+ mu sync.RWMutex
+ m map[string]interface{}
+}
+
+func NewContext() *Context {
+ m := make(map[string]interface{})
+ return &Context{m: m}
+}
+
+func (c *Context) Get(key string) interface{} {
+ if !c.Exists(key) {
+ return nil
+ }
+ c.mu.RLock()
+ defer c.mu.RUnlock()
+ return c.m[key]
+}
+
+func (c *Context) Put(key string, val interface{}) *Context {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ c.m[key] = val
+ return c
+}
+
+func (c *Context) Delete(key string) *Context {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ delete(c.m, key)
+ return c
+}
+
+func (c *Context) Exists(key string) bool {
+ c.mu.RLock()
+ defer c.mu.RUnlock()
+ _, ok := c.m[key]
+ return ok
+}
+
+func (c *Context) copy() *Context {
+ nc := NewContext()
+ c.mu.RLock()
+ defer c.mu.RUnlock()
+ for k, v := range c.m {
+ nc.m[k] = v
+ }
+ return nc
+}
diff --git a/src/vendor/github.com/alexedwards/stack/context_test.go b/src/vendor/github.com/alexedwards/stack/context_test.go
new file mode 100644
index 0000000..469200e
--- /dev/null
+++ b/src/vendor/github.com/alexedwards/stack/context_test.go
@@ -0,0 +1,48 @@
+package stack
+
+import "testing"
+
+func TestGet(t *testing.T) {
+ ctx := NewContext()
+ ctx.m["flip"] = "flop"
+ ctx.m["bish"] = nil
+
+ val := ctx.Get("flip")
+ assertEquals(t, "flop", val)
+
+ val = ctx.Get("bish")
+ assertEquals(t, nil, val)
+}
+
+func TestPut(t *testing.T) {
+ ctx := NewContext()
+
+ ctx.Put("bish", "bash")
+ assertEquals(t, "bash", ctx.m["bish"])
+}
+
+func TestDelete(t *testing.T) {
+ ctx := NewContext()
+ ctx.m["flip"] = "flop"
+
+ ctx.Delete("flip")
+ assertEquals(t, nil, ctx.m["flip"])
+}
+
+func TestCopy(t *testing.T) {
+ ctx := NewContext()
+ ctx.m["flip"] = "flop"
+
+ ctx2 := ctx.copy()
+ ctx2.m["bish"] = "bash"
+ assertEquals(t, nil, ctx.m["bish"])
+ assertEquals(t, "bash", ctx2.m["bish"])
+}
+
+func TestExists(t *testing.T) {
+ ctx := NewContext()
+ ctx.m["flip"] = "flop"
+
+ assertEquals(t, true, ctx.Exists("flip"))
+ assertEquals(t, false, ctx.Exists("bash"))
+}
diff --git a/src/vendor/github.com/alexedwards/stack/stack.go b/src/vendor/github.com/alexedwards/stack/stack.go
new file mode 100644
index 0000000..47c42b2
--- /dev/null
+++ b/src/vendor/github.com/alexedwards/stack/stack.go
@@ -0,0 +1,94 @@
+package stack
+
+import "net/http"
+
+type chainHandler func(*Context) http.Handler
+type chainMiddleware func(*Context, http.Handler) http.Handler
+
+type Chain struct {
+ mws []chainMiddleware
+ h chainHandler
+}
+
+func New(mws ...chainMiddleware) Chain {
+ return Chain{mws: mws}
+}
+
+func (c Chain) Append(mws ...chainMiddleware) Chain {
+ newMws := make([]chainMiddleware, len(c.mws)+len(mws))
+ copy(newMws[:len(c.mws)], c.mws)
+ copy(newMws[len(c.mws):], mws)
+ c.mws = newMws
+ return c
+}
+
+func (c Chain) Then(chf func(ctx *Context, w http.ResponseWriter, r *http.Request)) HandlerChain {
+ c.h = adaptContextHandlerFunc(chf)
+ return newHandlerChain(c)
+}
+
+func (c Chain) ThenHandler(h http.Handler) HandlerChain {
+ c.h = adaptHandler(h)
+ return newHandlerChain(c)
+}
+
+func (c Chain) ThenHandlerFunc(fn func(http.ResponseWriter, *http.Request)) HandlerChain {
+ c.h = adaptHandlerFunc(fn)
+ return newHandlerChain(c)
+}
+
+type HandlerChain struct {
+ context *Context
+ Chain
+}
+
+func newHandlerChain(c Chain) HandlerChain {
+ return HandlerChain{context: NewContext(), Chain: c}
+}
+
+func (hc HandlerChain) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+ // Always take a copy of context (i.e. pointing to a brand new memory location)
+ ctx := hc.context.copy()
+
+ final := hc.h(ctx)
+ for i := len(hc.mws) - 1; i >= 0; i-- {
+ final = hc.mws[i](ctx, final)
+ }
+ final.ServeHTTP(w, r)
+}
+
+func Inject(hc HandlerChain, key string, val interface{}) HandlerChain {
+ hc.context = hc.context.copy().Put(key, val)
+ return hc
+}
+
+// Adapt third party middleware with the signature
+// func(http.Handler) http.Handler into chainMiddleware
+func Adapt(fn func(http.Handler) http.Handler) chainMiddleware {
+ return func(ctx *Context, h http.Handler) http.Handler {
+ return fn(h)
+ }
+}
+
+// Adapt http.Handler into a chainHandler
+func adaptHandler(h http.Handler) chainHandler {
+ return func(ctx *Context) http.Handler {
+ return h
+ }
+}
+
+// Adapt a function with the signature
+// func(http.ResponseWriter, *http.Request) into a chainHandler
+func adaptHandlerFunc(fn func(w http.ResponseWriter, r *http.Request)) chainHandler {
+ return adaptHandler(http.HandlerFunc(fn))
+}
+
+// Adapt a function with the signature
+// func(Context, http.ResponseWriter, *http.Request) into a chainHandler
+func adaptContextHandlerFunc(fn func(ctx *Context, w http.ResponseWriter, r *http.Request)) chainHandler {
+ return func(ctx *Context) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ fn(ctx, w, r)
+ })
+ }
+}
diff --git a/src/vendor/github.com/alexedwards/stack/stack_test.go b/src/vendor/github.com/alexedwards/stack/stack_test.go
new file mode 100644
index 0000000..28aa0ae
--- /dev/null
+++ b/src/vendor/github.com/alexedwards/stack/stack_test.go
@@ -0,0 +1,126 @@
+package stack
+
+import (
+ "fmt"
+ "io/ioutil"
+ "log"
+ "net/http"
+ "net/http/httptest"
+ "testing"
+)
+
+func assertEquals(t *testing.T, e interface{}, o interface{}) {
+ if e != o {
+ t.Errorf("\n...expected = %v\n...obtained = %v", e, o)
+ }
+}
+
+func serveAndRequest(h http.Handler) string {
+ ts := httptest.NewServer(h)
+ defer ts.Close()
+ res, err := http.Get(ts.URL)
+ if err != nil {
+ log.Fatal(err)
+ }
+ resBody, err := ioutil.ReadAll(res.Body)
+ res.Body.Close()
+ if err != nil {
+ log.Fatal(err)
+ }
+ return string(resBody)
+}
+
+func bishMiddleware(ctx *Context, next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ ctx.Put("bish", "bash")
+ fmt.Fprintf(w, "bishMiddleware>")
+ next.ServeHTTP(w, r)
+ })
+}
+
+func flipMiddleware(ctx *Context, next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprintf(w, "flipMiddleware>")
+ next.ServeHTTP(w, r)
+ })
+}
+
+func wobbleMiddleware(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprintf(w, "wobbleMiddleware>")
+ next.ServeHTTP(w, r)
+ })
+}
+
+func bishHandler(ctx *Context, w http.ResponseWriter, r *http.Request) {
+ val := ctx.Get("bish")
+ fmt.Fprintf(w, "bishHandler [bish=%v]", val)
+}
+
+func flipHandler(ctx *Context, w http.ResponseWriter, r *http.Request) {
+ valb := ctx.Get("bish")
+ valf := ctx.Get("flip")
+ fmt.Fprintf(w, "flipHandler [bish=%v,flip=%v]", valb, valf)
+}
+
+func TestNew(t *testing.T) {
+ st := New(bishMiddleware, flipMiddleware).Then(bishHandler)
+ res := serveAndRequest(st)
+ assertEquals(t, "bishMiddleware>flipMiddleware>bishHandler [bish=bash]", res)
+}
+
+func TestAppend(t *testing.T) {
+ st := New(bishMiddleware).Append(flipMiddleware, flipMiddleware).Then(bishHandler)
+ res := serveAndRequest(st)
+ assertEquals(t, "bishMiddleware>flipMiddleware>flipMiddleware>bishHandler [bish=bash]", res)
+}
+
+func TestAppendDoesNotMutate(t *testing.T) {
+ st1 := New(bishMiddleware, flipMiddleware)
+ st2 := st1.Append(flipMiddleware, flipMiddleware)
+ res := serveAndRequest(st1.Then(bishHandler))
+ assertEquals(t, "bishMiddleware>flipMiddleware>bishHandler [bish=bash]", res)
+ res = serveAndRequest(st2.Then(bishHandler))
+ assertEquals(t, "bishMiddleware>flipMiddleware>flipMiddleware>flipMiddleware>bishHandler [bish=bash]", res)
+}
+
+func TestThen(t *testing.T) {
+ chf := func(ctx *Context, w http.ResponseWriter, r *http.Request) {
+ fmt.Fprint(w, "An anonymous ContextHandlerFunc")
+ }
+ st := New().Then(chf)
+ res := serveAndRequest(st)
+ assertEquals(t, "An anonymous ContextHandlerFunc", res)
+}
+
+func TestThenHandler(t *testing.T) {
+ st := New().ThenHandler(http.NotFoundHandler())
+ res := serveAndRequest(st)
+ assertEquals(t, "404 page not found\n", res)
+}
+
+func TestThenHandlerFunc(t *testing.T) {
+ hf := func(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprint(w, "An anonymous HandlerFunc")
+ }
+ st := New().ThenHandlerFunc(hf)
+ res := serveAndRequest(st)
+ assertEquals(t, "An anonymous HandlerFunc", res)
+}
+
+func TestMixedMiddleware(t *testing.T) {
+ st := New(bishMiddleware, Adapt(wobbleMiddleware), flipMiddleware).Then(bishHandler)
+ res := serveAndRequest(st)
+ assertEquals(t, "bishMiddleware>wobbleMiddleware>flipMiddleware>bishHandler [bish=bash]", res)
+}
+
+func TestInject(t *testing.T) {
+ st := New(flipMiddleware).Then(flipHandler)
+ st2 := Inject(st, "bish", "boop")
+
+ res := serveAndRequest(st2)
+ assertEquals(t, "flipMiddleware>flipHandler [bish=boop,flip=<nil>]", res)
+
+ res = serveAndRequest(st)
+ assertEquals(t, "flipMiddleware>flipHandler [bish=<nil>,flip=<nil>]", res)
+}
diff --git a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/.travis.yml b/src/vendor/github.com/julienschmidt/httprouter/.travis.yml
index 9a3c1a8..9a3c1a8 100644
--- a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/.travis.yml
+++ b/src/vendor/github.com/julienschmidt/httprouter/.travis.yml
diff --git a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/LICENSE b/src/vendor/github.com/julienschmidt/httprouter/LICENSE
index b829abc..b829abc 100644
--- a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/LICENSE
+++ b/src/vendor/github.com/julienschmidt/httprouter/LICENSE
diff --git a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/README.md b/src/vendor/github.com/julienschmidt/httprouter/README.md
index 7b467f5..7b467f5 100644
--- a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/README.md
+++ b/src/vendor/github.com/julienschmidt/httprouter/README.md
diff --git a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/path.go b/src/vendor/github.com/julienschmidt/httprouter/path.go
index 486134d..486134d 100644
--- a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/path.go
+++ b/src/vendor/github.com/julienschmidt/httprouter/path.go
diff --git a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/path_test.go b/src/vendor/github.com/julienschmidt/httprouter/path_test.go
index c4ceda5..c4ceda5 100644
--- a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/path_test.go
+++ b/src/vendor/github.com/julienschmidt/httprouter/path_test.go
diff --git a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/router.go b/src/vendor/github.com/julienschmidt/httprouter/router.go
index 8b5ff34..8b5ff34 100644
--- a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/router.go
+++ b/src/vendor/github.com/julienschmidt/httprouter/router.go
diff --git a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/router_test.go b/src/vendor/github.com/julienschmidt/httprouter/router_test.go
index e3141bd..e3141bd 100644
--- a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/router_test.go
+++ b/src/vendor/github.com/julienschmidt/httprouter/router_test.go
diff --git a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/tree.go b/src/vendor/github.com/julienschmidt/httprouter/tree.go
index faf5fdc..faf5fdc 100644
--- a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/tree.go
+++ b/src/vendor/github.com/julienschmidt/httprouter/tree.go
diff --git a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/tree_test.go b/src/vendor/github.com/julienschmidt/httprouter/tree_test.go
index 46d3299..46d3299 100644
--- a/src/dict2rest/vendor/github.com/julienschmidt/httprouter/tree_test.go
+++ b/src/vendor/github.com/julienschmidt/httprouter/tree_test.go
diff --git a/src/dict2rest/vendor/github.com/justinas/alice/.travis.yml b/src/vendor/github.com/justinas/alice/.travis.yml
index 9398694..9398694 100644
--- a/src/dict2rest/vendor/github.com/justinas/alice/.travis.yml
+++ b/src/vendor/github.com/justinas/alice/.travis.yml
diff --git a/src/dict2rest/vendor/github.com/justinas/alice/LICENSE b/src/vendor/github.com/justinas/alice/LICENSE
index 0d0d352..0d0d352 100644
--- a/src/dict2rest/vendor/github.com/justinas/alice/LICENSE
+++ b/src/vendor/github.com/justinas/alice/LICENSE
diff --git a/src/dict2rest/vendor/github.com/justinas/alice/README.md b/src/vendor/github.com/justinas/alice/README.md
index 88d2134..88d2134 100644
--- a/src/dict2rest/vendor/github.com/justinas/alice/README.md
+++ b/src/vendor/github.com/justinas/alice/README.md
diff --git a/src/dict2rest/vendor/github.com/justinas/alice/chain.go b/src/vendor/github.com/justinas/alice/chain.go
index d281ad3..d281ad3 100644
--- a/src/dict2rest/vendor/github.com/justinas/alice/chain.go
+++ b/src/vendor/github.com/justinas/alice/chain.go
diff --git a/src/dict2rest/vendor/github.com/justinas/alice/chain_test.go b/src/vendor/github.com/justinas/alice/chain_test.go
index 49c0470..49c0470 100644
--- a/src/dict2rest/vendor/github.com/justinas/alice/chain_test.go
+++ b/src/vendor/github.com/justinas/alice/chain_test.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/.travis.yml b/src/vendor/github.com/rs/cors/.travis.yml
index bbb5185..bbb5185 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/.travis.yml
+++ b/src/vendor/github.com/rs/cors/.travis.yml
diff --git a/src/dict2rest/vendor/github.com/rs/cors/LICENSE b/src/vendor/github.com/rs/cors/LICENSE
index d8e2df5..d8e2df5 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/LICENSE
+++ b/src/vendor/github.com/rs/cors/LICENSE
diff --git a/src/dict2rest/vendor/github.com/rs/cors/README.md b/src/vendor/github.com/rs/cors/README.md
index 4bf5672..4bf5672 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/README.md
+++ b/src/vendor/github.com/rs/cors/README.md
diff --git a/src/dict2rest/vendor/github.com/rs/cors/bench_test.go b/src/vendor/github.com/rs/cors/bench_test.go
index b6e3721..b6e3721 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/bench_test.go
+++ b/src/vendor/github.com/rs/cors/bench_test.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/cors.go b/src/vendor/github.com/rs/cors/cors.go
index 6616061..6616061 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/cors.go
+++ b/src/vendor/github.com/rs/cors/cors.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/cors_test.go b/src/vendor/github.com/rs/cors/cors_test.go
index 28672a0..28672a0 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/cors_test.go
+++ b/src/vendor/github.com/rs/cors/cors_test.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/examples/alice/server.go b/src/vendor/github.com/rs/cors/examples/alice/server.go
index 0a3e15c..0a3e15c 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/examples/alice/server.go
+++ b/src/vendor/github.com/rs/cors/examples/alice/server.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/examples/default/server.go b/src/vendor/github.com/rs/cors/examples/default/server.go
index ccb5e1b..ccb5e1b 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/examples/default/server.go
+++ b/src/vendor/github.com/rs/cors/examples/default/server.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/examples/goji/server.go b/src/vendor/github.com/rs/cors/examples/goji/server.go
index 1fb4073..1fb4073 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/examples/goji/server.go
+++ b/src/vendor/github.com/rs/cors/examples/goji/server.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/examples/martini/server.go b/src/vendor/github.com/rs/cors/examples/martini/server.go
index 081af32..081af32 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/examples/martini/server.go
+++ b/src/vendor/github.com/rs/cors/examples/martini/server.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/examples/negroni/server.go b/src/vendor/github.com/rs/cors/examples/negroni/server.go
index 3cb33bf..3cb33bf 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/examples/negroni/server.go
+++ b/src/vendor/github.com/rs/cors/examples/negroni/server.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/examples/nethttp/server.go b/src/vendor/github.com/rs/cors/examples/nethttp/server.go
index eaa775e..eaa775e 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/examples/nethttp/server.go
+++ b/src/vendor/github.com/rs/cors/examples/nethttp/server.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/examples/openbar/server.go b/src/vendor/github.com/rs/cors/examples/openbar/server.go
index 0940423..0940423 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/examples/openbar/server.go
+++ b/src/vendor/github.com/rs/cors/examples/openbar/server.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/examples/xhandler/server.go b/src/vendor/github.com/rs/cors/examples/xhandler/server.go
index 649a1c7..649a1c7 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/examples/xhandler/server.go
+++ b/src/vendor/github.com/rs/cors/examples/xhandler/server.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/utils.go b/src/vendor/github.com/rs/cors/utils.go
index cd24831..cd24831 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/utils.go
+++ b/src/vendor/github.com/rs/cors/utils.go
diff --git a/src/dict2rest/vendor/github.com/rs/cors/utils_test.go b/src/vendor/github.com/rs/cors/utils_test.go
index 83053b3..83053b3 100644
--- a/src/dict2rest/vendor/github.com/rs/cors/utils_test.go
+++ b/src/vendor/github.com/rs/cors/utils_test.go
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/.travis.yml b/src/vendor/github.com/rs/xhandler/.travis.yml
index b65c7a9..b65c7a9 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/.travis.yml
+++ b/src/vendor/github.com/rs/xhandler/.travis.yml
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/LICENSE b/src/vendor/github.com/rs/xhandler/LICENSE
index 47c5e9d..47c5e9d 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/LICENSE
+++ b/src/vendor/github.com/rs/xhandler/LICENSE
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/README.md b/src/vendor/github.com/rs/xhandler/README.md
index 91c594b..91c594b 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/README.md
+++ b/src/vendor/github.com/rs/xhandler/README.md
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/chain.go b/src/vendor/github.com/rs/xhandler/chain.go
index 042274d..042274d 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/chain.go
+++ b/src/vendor/github.com/rs/xhandler/chain.go
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/chain_example_test.go b/src/vendor/github.com/rs/xhandler/chain_example_test.go
index 005b5b2..005b5b2 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/chain_example_test.go
+++ b/src/vendor/github.com/rs/xhandler/chain_example_test.go
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/chain_test.go b/src/vendor/github.com/rs/xhandler/chain_test.go
index 0ce9410..0ce9410 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/chain_test.go
+++ b/src/vendor/github.com/rs/xhandler/chain_test.go
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/middleware.go b/src/vendor/github.com/rs/xhandler/middleware.go
index 5de1364..5de1364 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/middleware.go
+++ b/src/vendor/github.com/rs/xhandler/middleware.go
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/middleware_test.go b/src/vendor/github.com/rs/xhandler/middleware_test.go
index 51306e3..51306e3 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/middleware_test.go
+++ b/src/vendor/github.com/rs/xhandler/middleware_test.go
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/xhandler.go b/src/vendor/github.com/rs/xhandler/xhandler.go
index 0dfcddf..0dfcddf 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/xhandler.go
+++ b/src/vendor/github.com/rs/xhandler/xhandler.go
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/xhandler_example_test.go b/src/vendor/github.com/rs/xhandler/xhandler_example_test.go
index 9f6f8a5..9f6f8a5 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/xhandler_example_test.go
+++ b/src/vendor/github.com/rs/xhandler/xhandler_example_test.go
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/xhandler_test.go b/src/vendor/github.com/rs/xhandler/xhandler_test.go
index 3f5021f..3f5021f 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/xhandler_test.go
+++ b/src/vendor/github.com/rs/xhandler/xhandler_test.go
diff --git a/src/dict2rest/vendor/github.com/rs/xhandler/xmux/README.md b/src/vendor/github.com/rs/xhandler/xmux/README.md
index 6ea3c0f..6ea3c0f 100644
--- a/src/dict2rest/vendor/github.com/rs/xhandler/xmux/README.md
+++ b/src/vendor/github.com/rs/xhandler/xmux/README.md
diff --git a/src/dict2rest/vendor/github.com/stretchr/graceful/.gitignore b/src/vendor/github.com/stretchr/graceful/.gitignore
index 8365624..8365624 100644
--- a/src/dict2rest/vendor/github.com/stretchr/graceful/.gitignore
+++ b/src/vendor/github.com/stretchr/graceful/.gitignore
diff --git a/src/dict2rest/vendor/github.com/stretchr/graceful/LICENSE b/src/vendor/github.com/stretchr/graceful/LICENSE
index a4f2f28..a4f2f28 100644
--- a/src/dict2rest/vendor/github.com/stretchr/graceful/LICENSE
+++ b/src/vendor/github.com/stretchr/graceful/LICENSE
diff --git a/src/dict2rest/vendor/github.com/stretchr/graceful/README.md b/src/vendor/github.com/stretchr/graceful/README.md
index 531249a..531249a 100644
--- a/src/dict2rest/vendor/github.com/stretchr/graceful/README.md
+++ b/src/vendor/github.com/stretchr/graceful/README.md
diff --git a/src/dict2rest/vendor/github.com/stretchr/graceful/graceful.go b/src/vendor/github.com/stretchr/graceful/graceful.go
index d3a7175..d3a7175 100644
--- a/src/dict2rest/vendor/github.com/stretchr/graceful/graceful.go
+++ b/src/vendor/github.com/stretchr/graceful/graceful.go
diff --git a/src/dict2rest/vendor/github.com/stretchr/graceful/graceful_test.go b/src/vendor/github.com/stretchr/graceful/graceful_test.go
index 83acac3..83acac3 100644
--- a/src/dict2rest/vendor/github.com/stretchr/graceful/graceful_test.go
+++ b/src/vendor/github.com/stretchr/graceful/graceful_test.go
diff --git a/src/dict2rest/vendor/github.com/stretchr/graceful/tests/main.go b/src/vendor/github.com/stretchr/graceful/tests/main.go
index 8c8fa20..8c8fa20 100644
--- a/src/dict2rest/vendor/github.com/stretchr/graceful/tests/main.go
+++ b/src/vendor/github.com/stretchr/graceful/tests/main.go
diff --git a/src/dict2rest/vendor/golang.org/x/net/context/context.go b/src/vendor/golang.org/x/net/context/context.go
index 77b64d0..77b64d0 100644
--- a/src/dict2rest/vendor/golang.org/x/net/context/context.go
+++ b/src/vendor/golang.org/x/net/context/context.go
diff --git a/src/dict2rest/vendor/golang.org/x/net/context/context_test.go b/src/vendor/golang.org/x/net/context/context_test.go
index 05345fc..05345fc 100644
--- a/src/dict2rest/vendor/golang.org/x/net/context/context_test.go
+++ b/src/vendor/golang.org/x/net/context/context_test.go
diff --git a/src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go b/src/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go
index e3170e3..e3170e3 100644
--- a/src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go
+++ b/src/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go
diff --git a/src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go b/src/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go
index 56bcbad..56bcbad 100644
--- a/src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go
+++ b/src/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go
diff --git a/src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go b/src/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go
index 62620d4..62620d4 100644
--- a/src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go
+++ b/src/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go
diff --git a/src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go b/src/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go
index 77c25ba..77c25ba 100644
--- a/src/dict2rest/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go
+++ b/src/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go
diff --git a/src/dict2rest/vendor/golang.org/x/net/context/withtimeout_test.go b/src/vendor/golang.org/x/net/context/withtimeout_test.go
index a6754dc..a6754dc 100644
--- a/src/dict2rest/vendor/golang.org/x/net/context/withtimeout_test.go
+++ b/src/vendor/golang.org/x/net/context/withtimeout_test.go
diff --git a/src/dict2rest/vendor/golang.org/x/net/dict/dict.go b/src/vendor/golang.org/x/net/dict/dict.go
index 58fef89..58fef89 100644
--- a/src/dict2rest/vendor/golang.org/x/net/dict/dict.go
+++ b/src/vendor/golang.org/x/net/dict/dict.go
diff --git a/src/dict2rest/vendor/golang.org/x/net/netutil/listen.go b/src/vendor/golang.org/x/net/netutil/listen.go
index b317ba2..b317ba2 100644
--- a/src/dict2rest/vendor/golang.org/x/net/netutil/listen.go
+++ b/src/vendor/golang.org/x/net/netutil/listen.go
diff --git a/src/dict2rest/vendor/golang.org/x/net/netutil/listen_test.go b/src/vendor/golang.org/x/net/netutil/listen_test.go
index c1a3d55..c1a3d55 100644
--- a/src/dict2rest/vendor/golang.org/x/net/netutil/listen_test.go
+++ b/src/vendor/golang.org/x/net/netutil/listen_test.go