From 701d1ab638b23c24877fc41824add66232446676 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 2 Feb 2017 09:32:00 -0500 Subject: Updating server dependancies (#5249) --- vendor/github.com/prometheus/common/route/route.go | 7 ++++--- vendor/github.com/prometheus/common/route/route_test.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'vendor/github.com/prometheus/common/route') diff --git a/vendor/github.com/prometheus/common/route/route.go b/vendor/github.com/prometheus/common/route/route.go index 930b52d4f..1e5638ed9 100644 --- a/vendor/github.com/prometheus/common/route/route.go +++ b/vendor/github.com/prometheus/common/route/route.go @@ -33,18 +33,19 @@ func WithParam(ctx context.Context, p, v string) context.Context { return context.WithValue(ctx, param(p), v) } -type contextFn func(r *http.Request) (context.Context, error) +// ContextFunc returns a new context for a request. +type ContextFunc func(r *http.Request) (context.Context, error) // Router wraps httprouter.Router and adds support for prefixed sub-routers // and per-request context injections. type Router struct { rtr *httprouter.Router prefix string - ctxFn contextFn + ctxFn ContextFunc } // New returns a new Router. -func New(ctxFn contextFn) *Router { +func New(ctxFn ContextFunc) *Router { if ctxFn == nil { ctxFn = func(r *http.Request) (context.Context, error) { return context.Background(), nil diff --git a/vendor/github.com/prometheus/common/route/route_test.go b/vendor/github.com/prometheus/common/route/route_test.go index 4055d69d5..e7b1cba33 100644 --- a/vendor/github.com/prometheus/common/route/route_test.go +++ b/vendor/github.com/prometheus/common/route/route_test.go @@ -29,7 +29,7 @@ func TestRedirect(t *testing.T) { } } -func TestContextFn(t *testing.T) { +func TestContextFunc(t *testing.T) { router := New(func(r *http.Request) (context.Context, error) { return context.WithValue(context.Background(), "testkey", "testvalue"), nil }) -- cgit v1.2.3-1-g7c22