From 43f32731f60c7366f060e375e85003fdecc29fb2 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 29 Jul 2023 17:53:26 +0200 Subject: [PATCH] Move internal packages --- cmd/app/main.go | 4 ++-- {handlers => internal/handlers}/after_logout.go | 2 +- {handlers => internal/handlers}/common.go | 4 ++-- {handlers => internal/handlers}/errors.go | 2 +- {handlers => internal/handlers}/index.go | 2 +- {handlers => internal/handlers}/observability.go | 0 {handlers => internal/handlers}/oidc_callback.go | 2 +- {handlers => internal/handlers}/security.go | 0 {handlers => internal/handlers}/startup.go | 0 {models => internal/models}/oidc.go | 0 {services => internal/services}/configuration.go | 0 {services => internal/services}/i18n.go | 0 {services => internal/services}/oidc.go | 2 +- {services => internal/services}/security.go | 0 {services => internal/services}/session.go | 0 15 files changed, 9 insertions(+), 9 deletions(-) rename {handlers => internal/handlers}/after_logout.go (95%) rename {handlers => internal/handlers}/common.go (96%) rename {handlers => internal/handlers}/errors.go (98%) rename {handlers => internal/handlers}/index.go (98%) rename {handlers => internal/handlers}/observability.go (100%) rename {handlers => internal/handlers}/oidc_callback.go (98%) rename {handlers => internal/handlers}/security.go (100%) rename {handlers => internal/handlers}/startup.go (100%) rename {models => internal/models}/oidc.go (100%) rename {services => internal/services}/configuration.go (100%) rename {services => internal/services}/i18n.go (100%) rename {services => internal/services}/oidc.go (98%) rename {services => internal/services}/security.go (100%) rename {services => internal/services}/session.go (100%) diff --git a/cmd/app/main.go b/cmd/app/main.go index 1cdc03e..a41ac82 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -34,8 +34,8 @@ import ( "code.cacert.org/cacert/oidc-demo-app/ui" - "code.cacert.org/cacert/oidc-demo-app/handlers" - "code.cacert.org/cacert/oidc-demo-app/services" + "code.cacert.org/cacert/oidc-demo-app/internal/handlers" + "code.cacert.org/cacert/oidc-demo-app/internal/services" ) const ( diff --git a/handlers/after_logout.go b/internal/handlers/after_logout.go similarity index 95% rename from handlers/after_logout.go rename to internal/handlers/after_logout.go index 1e1d65c..2b86743 100644 --- a/handlers/after_logout.go +++ b/internal/handlers/after_logout.go @@ -22,7 +22,7 @@ import ( "github.com/sirupsen/logrus" - "code.cacert.org/cacert/oidc-demo-app/services" + "code.cacert.org/cacert/oidc-demo-app/internal/services" ) type AfterLogoutHandler struct { diff --git a/handlers/common.go b/internal/handlers/common.go similarity index 96% rename from handlers/common.go rename to internal/handlers/common.go index 965dd72..538e5d8 100644 --- a/handlers/common.go +++ b/internal/handlers/common.go @@ -32,8 +32,8 @@ import ( log "github.com/sirupsen/logrus" "golang.org/x/oauth2" - "code.cacert.org/cacert/oidc-demo-app/models" - "code.cacert.org/cacert/oidc-demo-app/services" + "code.cacert.org/cacert/oidc-demo-app/internal/models" + "code.cacert.org/cacert/oidc-demo-app/internal/services" ) const ( diff --git a/handlers/errors.go b/internal/handlers/errors.go similarity index 98% rename from handlers/errors.go rename to internal/handlers/errors.go index a3f4182..68043f2 100644 --- a/handlers/errors.go +++ b/internal/handlers/errors.go @@ -27,7 +27,7 @@ import ( "github.com/nicksnyder/go-i18n/v2/i18n" log "github.com/sirupsen/logrus" - "code.cacert.org/cacert/oidc-demo-app/services" + "code.cacert.org/cacert/oidc-demo-app/internal/services" ) type errorKey int diff --git a/handlers/index.go b/internal/handlers/index.go similarity index 98% rename from handlers/index.go rename to internal/handlers/index.go index 9257a86..0318490 100644 --- a/handlers/index.go +++ b/internal/handlers/index.go @@ -27,7 +27,7 @@ import ( "github.com/lestrrat-go/jwx/jwk" "github.com/nicksnyder/go-i18n/v2/i18n" - "code.cacert.org/cacert/oidc-demo-app/services" + "code.cacert.org/cacert/oidc-demo-app/internal/services" ) type IndexHandler struct { diff --git a/handlers/observability.go b/internal/handlers/observability.go similarity index 100% rename from handlers/observability.go rename to internal/handlers/observability.go diff --git a/handlers/oidc_callback.go b/internal/handlers/oidc_callback.go similarity index 98% rename from handlers/oidc_callback.go rename to internal/handlers/oidc_callback.go index 1853dc0..40e0157 100644 --- a/handlers/oidc_callback.go +++ b/internal/handlers/oidc_callback.go @@ -26,7 +26,7 @@ import ( log "github.com/sirupsen/logrus" "golang.org/x/oauth2" - "code.cacert.org/cacert/oidc-demo-app/services" + "code.cacert.org/cacert/oidc-demo-app/internal/services" ) const ( diff --git a/handlers/security.go b/internal/handlers/security.go similarity index 100% rename from handlers/security.go rename to internal/handlers/security.go diff --git a/handlers/startup.go b/internal/handlers/startup.go similarity index 100% rename from handlers/startup.go rename to internal/handlers/startup.go diff --git a/models/oidc.go b/internal/models/oidc.go similarity index 100% rename from models/oidc.go rename to internal/models/oidc.go diff --git a/services/configuration.go b/internal/services/configuration.go similarity index 100% rename from services/configuration.go rename to internal/services/configuration.go diff --git a/services/i18n.go b/internal/services/i18n.go similarity index 100% rename from services/i18n.go rename to internal/services/i18n.go diff --git a/services/oidc.go b/internal/services/oidc.go similarity index 98% rename from services/oidc.go rename to internal/services/oidc.go index d6b7ee5..2aab295 100644 --- a/services/oidc.go +++ b/internal/services/oidc.go @@ -30,7 +30,7 @@ import ( log "github.com/sirupsen/logrus" "golang.org/x/oauth2" - "code.cacert.org/cacert/oidc-demo-app/models" + "code.cacert.org/cacert/oidc-demo-app/internal/models" ) // OidcParams defines the parameters for DiscoverOIDC diff --git a/services/security.go b/internal/services/security.go similarity index 100% rename from services/security.go rename to internal/services/security.go diff --git a/services/session.go b/internal/services/session.go similarity index 100% rename from services/session.go rename to internal/services/session.go