From 40d9058bb6e1b14fd70df4b43b0b13fe3aa7630f Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Wed, 19 Jul 2017 12:02:51 +0200 Subject: [PATCH] refactor: migration Negroni from codegangsta to urfave --- README.md | 2 +- glide.lock | 6 ++---- glide.yaml | 4 +--- middlewares/accesslog/save_backend.go | 2 +- middlewares/authenticator.go | 2 +- middlewares/authenticator_test.go | 2 +- middlewares/error_pages_test.go | 2 +- middlewares/ip_whitelister.go | 2 +- middlewares/ip_whitelister_test.go | 2 +- middlewares/prometheus_test.go | 2 +- middlewares/recover.go | 2 +- middlewares/recover_test.go | 2 +- server/server.go | 2 +- server/server_test.go | 2 +- server/web.go | 2 +- vendor/github.com/{codegangsta => urfave}/negroni/LICENSE | 0 vendor/github.com/{codegangsta => urfave}/negroni/doc.go | 0 vendor/github.com/{codegangsta => urfave}/negroni/logger.go | 0 .../github.com/{codegangsta => urfave}/negroni/negroni.go | 0 .../github.com/{codegangsta => urfave}/negroni/recovery.go | 0 .../{codegangsta => urfave}/negroni/response_writer.go | 0 vendor/github.com/{codegangsta => urfave}/negroni/static.go | 0 22 files changed, 16 insertions(+), 20 deletions(-) rename vendor/github.com/{codegangsta => urfave}/negroni/LICENSE (100%) rename vendor/github.com/{codegangsta => urfave}/negroni/doc.go (100%) rename vendor/github.com/{codegangsta => urfave}/negroni/logger.go (100%) rename vendor/github.com/{codegangsta => urfave}/negroni/negroni.go (100%) rename vendor/github.com/{codegangsta => urfave}/negroni/recovery.go (100%) rename vendor/github.com/{codegangsta => urfave}/negroni/response_writer.go (100%) rename vendor/github.com/{codegangsta => urfave}/negroni/static.go (100%) diff --git a/README.md b/README.md index 8401bc6d2..95bb494c7 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ You can access the simple HTML frontend of Træfik. - [Oxy](https://github.com/vulcand/oxy): an awesome proxy library made by Mailgun folks - [Gorilla mux](https://github.com/gorilla/mux): famous request router -- [Negroni](https://github.com/codegangsta/negroni): web middlewares made simple +- [Negroni](https://github.com/urfave/negroni): web middlewares made simple - [Lego](https://github.com/xenolf/lego): the best [Let's Encrypt](https://letsencrypt.org) library in go ## Test it diff --git a/glide.lock b/glide.lock index 904c48a3c..c62bff49b 100644 --- a/glide.lock +++ b/glide.lock @@ -1,4 +1,4 @@ -hash: 61dae796d71e48c988433d0655e9c6ae64a1954a6a54b9b00a5db7e759dbca0e +hash: 6aff4c6177ddc3247530d141a93f5bb044ee72acaa63b5667ceb205828c8ad03 updated: 2017-07-11T23:50:31.241672481+02:00 imports: - name: cloud.google.com/go @@ -82,10 +82,8 @@ imports: version: 9208b142303c12d8899bae836fd524ac9338b4fd - name: github.com/codegangsta/cli version: bf4a526f48af7badd25d2cb02d587e1b01be3b50 -- name: github.com/codegangsta/negroni +- name: github.com/urfave/negroni version: 490e6a555d47ca891a89a150d0c1ef3922dfffe9 - repo: https://github.com/urfave/negroni.git - vcs: git - name: github.com/containous/flaeg version: b5d2dc5878df07c2d74413348186982e7b865871 - name: github.com/containous/mux diff --git a/glide.yaml b/glide.yaml index e17c62b09..96df81cf1 100644 --- a/glide.yaml +++ b/glide.yaml @@ -22,10 +22,8 @@ import: - roundrobin - stream - utils -- name: github.com/codegangsta/negroni +- name: github.com/urfave/negroni version: 490e6a555d47ca891a89a150d0c1ef3922dfffe9 - repo: https://github.com/urfave/negroni.git - vcs: git - package: github.com/containous/staert version: 1e26a71803e428fd933f5f9c8e50a26878f53147 - package: github.com/docker/docker diff --git a/middlewares/accesslog/save_backend.go b/middlewares/accesslog/save_backend.go index e2bf7377d..9f931702b 100644 --- a/middlewares/accesslog/save_backend.go +++ b/middlewares/accesslog/save_backend.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/codegangsta/negroni" + "github.com/urfave/negroni" "github.com/vulcand/oxy/utils" ) diff --git a/middlewares/authenticator.go b/middlewares/authenticator.go index e70f9899d..d9ccc10fb 100644 --- a/middlewares/authenticator.go +++ b/middlewares/authenticator.go @@ -7,9 +7,9 @@ import ( "strings" "github.com/abbot/go-http-auth" - "github.com/codegangsta/negroni" "github.com/containous/traefik/log" "github.com/containous/traefik/types" + "github.com/urfave/negroni" ) // Authenticator is a middleware that provides HTTP basic and digest authentication diff --git a/middlewares/authenticator_test.go b/middlewares/authenticator_test.go index f8c51a672..c68637f68 100644 --- a/middlewares/authenticator_test.go +++ b/middlewares/authenticator_test.go @@ -8,10 +8,10 @@ import ( "os" "testing" - "github.com/codegangsta/negroni" "github.com/containous/traefik/testhelpers" "github.com/containous/traefik/types" "github.com/stretchr/testify/assert" + "github.com/urfave/negroni" ) func TestAuthUsersFromFile(t *testing.T) { diff --git a/middlewares/error_pages_test.go b/middlewares/error_pages_test.go index e5027a66b..c24b94e31 100644 --- a/middlewares/error_pages_test.go +++ b/middlewares/error_pages_test.go @@ -7,9 +7,9 @@ import ( "strconv" "testing" - "github.com/codegangsta/negroni" "github.com/containous/traefik/types" "github.com/stretchr/testify/assert" + "github.com/urfave/negroni" ) func TestErrorPage(t *testing.T) { diff --git a/middlewares/ip_whitelister.go b/middlewares/ip_whitelister.go index 3af9e9e95..07a2108a1 100644 --- a/middlewares/ip_whitelister.go +++ b/middlewares/ip_whitelister.go @@ -5,9 +5,9 @@ import ( "net" "net/http" - "github.com/codegangsta/negroni" "github.com/containous/traefik/log" "github.com/pkg/errors" + "github.com/urfave/negroni" ) // IPWhitelister is a middleware that provides Checks of the Requesting IP against a set of Whitelists diff --git a/middlewares/ip_whitelister_test.go b/middlewares/ip_whitelister_test.go index 3c8a8f087..939af88bd 100644 --- a/middlewares/ip_whitelister_test.go +++ b/middlewares/ip_whitelister_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" - "github.com/codegangsta/negroni" "github.com/containous/traefik/testhelpers" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/urfave/negroni" ) func TestNewIPWhitelister(t *testing.T) { diff --git a/middlewares/prometheus_test.go b/middlewares/prometheus_test.go index 38bfa8807..c32f3cc3c 100644 --- a/middlewares/prometheus_test.go +++ b/middlewares/prometheus_test.go @@ -8,13 +8,13 @@ import ( "strings" "testing" - "github.com/codegangsta/negroni" "github.com/containous/traefik/testhelpers" "github.com/containous/traefik/types" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" dto "github.com/prometheus/client_model/go" "github.com/stretchr/testify/assert" + "github.com/urfave/negroni" ) func TestPrometheus(t *testing.T) { diff --git a/middlewares/recover.go b/middlewares/recover.go index fff7c2e0b..79af9eee4 100644 --- a/middlewares/recover.go +++ b/middlewares/recover.go @@ -3,8 +3,8 @@ package middlewares import ( "net/http" - "github.com/codegangsta/negroni" "github.com/containous/traefik/log" + "github.com/urfave/negroni" ) // RecoverHandler recovers from a panic in http handlers diff --git a/middlewares/recover_test.go b/middlewares/recover_test.go index 31cf098ca..3d5b70aa4 100644 --- a/middlewares/recover_test.go +++ b/middlewares/recover_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "github.com/codegangsta/negroni" + "github.com/urfave/negroni" ) func TestRecoverHandler(t *testing.T) { diff --git a/server/server.go b/server/server.go index 228d73cc2..36b522faf 100644 --- a/server/server.go +++ b/server/server.go @@ -18,7 +18,6 @@ import ( "syscall" "time" - "github.com/codegangsta/negroni" "github.com/containous/mux" "github.com/containous/traefik/cluster" "github.com/containous/traefik/healthcheck" @@ -29,6 +28,7 @@ import ( "github.com/containous/traefik/safe" "github.com/containous/traefik/types" "github.com/streamrail/concurrent-map" + "github.com/urfave/negroni" "github.com/vulcand/oxy/cbreaker" "github.com/vulcand/oxy/connlimit" "github.com/vulcand/oxy/forward" diff --git a/server/server_test.go b/server/server_test.go index 9822df16c..457449451 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -9,7 +9,6 @@ import ( "testing" "time" - "github.com/codegangsta/negroni" "github.com/containous/flaeg" "github.com/containous/mux" "github.com/containous/traefik/healthcheck" @@ -19,6 +18,7 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/urfave/negroni" "github.com/vulcand/oxy/roundrobin" ) diff --git a/server/web.go b/server/web.go index a55fe7dc8..cddf6f272 100644 --- a/server/web.go +++ b/server/web.go @@ -8,7 +8,6 @@ import ( "net/http" "runtime" - "github.com/codegangsta/negroni" "github.com/containous/mux" "github.com/containous/traefik/autogen" "github.com/containous/traefik/log" @@ -20,6 +19,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" thoas_stats "github.com/thoas/stats" "github.com/unrolled/render" + "github.com/urfave/negroni" ) var ( diff --git a/vendor/github.com/codegangsta/negroni/LICENSE b/vendor/github.com/urfave/negroni/LICENSE similarity index 100% rename from vendor/github.com/codegangsta/negroni/LICENSE rename to vendor/github.com/urfave/negroni/LICENSE diff --git a/vendor/github.com/codegangsta/negroni/doc.go b/vendor/github.com/urfave/negroni/doc.go similarity index 100% rename from vendor/github.com/codegangsta/negroni/doc.go rename to vendor/github.com/urfave/negroni/doc.go diff --git a/vendor/github.com/codegangsta/negroni/logger.go b/vendor/github.com/urfave/negroni/logger.go similarity index 100% rename from vendor/github.com/codegangsta/negroni/logger.go rename to vendor/github.com/urfave/negroni/logger.go diff --git a/vendor/github.com/codegangsta/negroni/negroni.go b/vendor/github.com/urfave/negroni/negroni.go similarity index 100% rename from vendor/github.com/codegangsta/negroni/negroni.go rename to vendor/github.com/urfave/negroni/negroni.go diff --git a/vendor/github.com/codegangsta/negroni/recovery.go b/vendor/github.com/urfave/negroni/recovery.go similarity index 100% rename from vendor/github.com/codegangsta/negroni/recovery.go rename to vendor/github.com/urfave/negroni/recovery.go diff --git a/vendor/github.com/codegangsta/negroni/response_writer.go b/vendor/github.com/urfave/negroni/response_writer.go similarity index 100% rename from vendor/github.com/codegangsta/negroni/response_writer.go rename to vendor/github.com/urfave/negroni/response_writer.go diff --git a/vendor/github.com/codegangsta/negroni/static.go b/vendor/github.com/urfave/negroni/static.go similarity index 100% rename from vendor/github.com/codegangsta/negroni/static.go rename to vendor/github.com/urfave/negroni/static.go