From fb9616160e7406c804e60f08bd73223ce5d1e40f Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Fri, 24 May 2019 17:08:48 +0100 Subject: [PATCH] Move logger to pkg/logger --- htpasswd.go | 2 +- http.go | 2 +- logging_handler.go | 2 +- logging_handler_test.go | 2 +- main.go | 2 +- oauthproxy.go | 2 +- oauthproxy_test.go | 2 +- options.go | 2 +- pkg/cookies/cookies.go | 2 +- {logger => pkg/logger}/logger.go | 0 pkg/requests/requests.go | 2 +- providers/azure.go | 2 +- providers/github.go | 2 +- providers/gitlab.go | 2 +- providers/google.go | 2 +- providers/internal_util.go | 2 +- templates.go | 2 +- validator.go | 2 +- watcher.go | 2 +- watcher_unsupported.go | 2 +- 20 files changed, 19 insertions(+), 19 deletions(-) rename {logger => pkg/logger}/logger.go (100%) diff --git a/htpasswd.go b/htpasswd.go index 0166e08..b7c8d57 100644 --- a/htpasswd.go +++ b/htpasswd.go @@ -7,7 +7,7 @@ import ( "io" "os" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" "golang.org/x/crypto/bcrypt" ) diff --git a/http.go b/http.go index 8ccc6f6..2cee227 100644 --- a/http.go +++ b/http.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" ) // Server represents an HTTP server diff --git a/logging_handler.go b/logging_handler.go index 77c2fca..b4f829d 100644 --- a/logging_handler.go +++ b/logging_handler.go @@ -10,7 +10,7 @@ import ( "net/http" "time" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" ) // responseLogger is wrapper of http.ResponseWriter that keeps track of its HTTP status diff --git a/logging_handler_test.go b/logging_handler_test.go index f92c7e0..fd77e0f 100644 --- a/logging_handler_test.go +++ b/logging_handler_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" ) func TestLoggingHandler_ServeHTTP(t *testing.T) { diff --git a/main.go b/main.go index a66c4fc..8af6461 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ import ( "github.com/BurntSushi/toml" options "github.com/mreiferson/go-options" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" ) func main() { diff --git a/oauthproxy.go b/oauthproxy.go index 62d1a18..fc4bb43 100644 --- a/oauthproxy.go +++ b/oauthproxy.go @@ -14,7 +14,7 @@ import ( "time" "github.com/mbland/hmacauth" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" sessionsapi "github.com/pusher/oauth2_proxy/pkg/apis/sessions" "github.com/pusher/oauth2_proxy/pkg/encryption" "github.com/pusher/oauth2_proxy/providers" diff --git a/oauthproxy_test.go b/oauthproxy_test.go index 1d09bbb..2fa3e00 100644 --- a/oauthproxy_test.go +++ b/oauthproxy_test.go @@ -15,7 +15,7 @@ import ( "time" "github.com/mbland/hmacauth" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" "github.com/pusher/oauth2_proxy/pkg/apis/sessions" "github.com/pusher/oauth2_proxy/pkg/sessions/cookie" "github.com/pusher/oauth2_proxy/providers" diff --git a/options.go b/options.go index 2b506e3..5053e94 100644 --- a/options.go +++ b/options.go @@ -17,7 +17,7 @@ import ( oidc "github.com/coreos/go-oidc" "github.com/dgrijalva/jwt-go" "github.com/mbland/hmacauth" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" "github.com/pusher/oauth2_proxy/pkg/apis/options" sessionsapi "github.com/pusher/oauth2_proxy/pkg/apis/sessions" "github.com/pusher/oauth2_proxy/pkg/encryption" diff --git a/pkg/cookies/cookies.go b/pkg/cookies/cookies.go index 08e6a9b..5a7343b 100644 --- a/pkg/cookies/cookies.go +++ b/pkg/cookies/cookies.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" "github.com/pusher/oauth2_proxy/pkg/apis/options" ) diff --git a/logger/logger.go b/pkg/logger/logger.go similarity index 100% rename from logger/logger.go rename to pkg/logger/logger.go diff --git a/pkg/requests/requests.go b/pkg/requests/requests.go index aac22e4..82d1176 100644 --- a/pkg/requests/requests.go +++ b/pkg/requests/requests.go @@ -7,7 +7,7 @@ import ( "net/http" "github.com/bitly/go-simplejson" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" ) // Request parses the request body into a simplejson.Json object diff --git a/providers/azure.go b/providers/azure.go index 3154432..12e2320 100644 --- a/providers/azure.go +++ b/providers/azure.go @@ -7,7 +7,7 @@ import ( "net/url" "github.com/bitly/go-simplejson" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" "github.com/pusher/oauth2_proxy/pkg/apis/sessions" "github.com/pusher/oauth2_proxy/pkg/requests" ) diff --git a/providers/github.go b/providers/github.go index b60ffe1..e1a7ed8 100644 --- a/providers/github.go +++ b/providers/github.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" "github.com/pusher/oauth2_proxy/pkg/apis/sessions" ) diff --git a/providers/gitlab.go b/providers/gitlab.go index c9a4a1f..f8e6739 100644 --- a/providers/gitlab.go +++ b/providers/gitlab.go @@ -4,7 +4,7 @@ import ( "net/http" "net/url" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" "github.com/pusher/oauth2_proxy/pkg/apis/sessions" "github.com/pusher/oauth2_proxy/pkg/requests" ) diff --git a/providers/google.go b/providers/google.go index 6f29c2c..e7821e2 100644 --- a/providers/google.go +++ b/providers/google.go @@ -13,7 +13,7 @@ import ( "strings" "time" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" "github.com/pusher/oauth2_proxy/pkg/apis/sessions" "golang.org/x/oauth2" "golang.org/x/oauth2/google" diff --git a/providers/internal_util.go b/providers/internal_util.go index bb5f4f5..0cf2a12 100644 --- a/providers/internal_util.go +++ b/providers/internal_util.go @@ -5,7 +5,7 @@ import ( "net/http" "net/url" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" "github.com/pusher/oauth2_proxy/pkg/requests" ) diff --git a/templates.go b/templates.go index ec1ba87..99637ed 100644 --- a/templates.go +++ b/templates.go @@ -4,7 +4,7 @@ import ( "html/template" "path" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" ) func loadTemplates(dir string) *template.Template { diff --git a/validator.go b/validator.go index 1a5c465..a0dc585 100644 --- a/validator.go +++ b/validator.go @@ -8,7 +8,7 @@ import ( "sync/atomic" "unsafe" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" ) // UserMap holds information from the authenticated emails file diff --git a/watcher.go b/watcher.go index 34e98d7..ed2bc0e 100644 --- a/watcher.go +++ b/watcher.go @@ -7,7 +7,7 @@ import ( "path/filepath" "time" - "github.com/pusher/oauth2_proxy/logger" + "github.com/pusher/oauth2_proxy/pkg/logger" fsnotify "gopkg.in/fsnotify/fsnotify.v1" ) diff --git a/watcher_unsupported.go b/watcher_unsupported.go index 1f6e3fc..ff708b7 100644 --- a/watcher_unsupported.go +++ b/watcher_unsupported.go @@ -2,7 +2,7 @@ package main -import "github.com/pusher/oauth2_proxy/logger" +import "github.com/pusher/oauth2_proxy/pkg/logger" func WatchForUpdates(filename string, done <-chan bool, action func()) { logger.Printf("file watching not implemented on this platform")