From 55b4a94281784f85621c26ad5d88f66e5f4f4747 Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Sun, 12 May 2019 00:28:11 +0200 Subject: [PATCH] gateway api: remove unused exposedURL variable --- internal/services/gateway/api/project.go | 27 +++++++++---------- internal/services/gateway/api/projectgroup.go | 9 +++---- internal/services/gateway/gateway.go | 8 +++--- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/internal/services/gateway/api/project.go b/internal/services/gateway/api/project.go index be5bed4..29bc950 100644 --- a/internal/services/gateway/api/project.go +++ b/internal/services/gateway/api/project.go @@ -38,13 +38,12 @@ type CreateProjectRequest struct { } type CreateProjectHandler struct { - log *zap.SugaredLogger - ah *action.ActionHandler - exposedURL string + log *zap.SugaredLogger + ah *action.ActionHandler } -func NewCreateProjectHandler(logger *zap.Logger, ah *action.ActionHandler, exposedURL string) *CreateProjectHandler { - return &CreateProjectHandler{log: logger.Sugar(), ah: ah, exposedURL: exposedURL} +func NewCreateProjectHandler(logger *zap.Logger, ah *action.ActionHandler) *CreateProjectHandler { + return &CreateProjectHandler{log: logger.Sugar(), ah: ah} } func (h *CreateProjectHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { @@ -79,13 +78,12 @@ func (h *CreateProjectHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) } type ProjectReconfigHandler struct { - log *zap.SugaredLogger - ah *action.ActionHandler - exposedURL string + log *zap.SugaredLogger + ah *action.ActionHandler } -func NewProjectReconfigHandler(logger *zap.Logger, ah *action.ActionHandler, exposedURL string) *ProjectReconfigHandler { - return &ProjectReconfigHandler{log: logger.Sugar(), ah: ah, exposedURL: exposedURL} +func NewProjectReconfigHandler(logger *zap.Logger, ah *action.ActionHandler) *ProjectReconfigHandler { + return &ProjectReconfigHandler{log: logger.Sugar(), ah: ah} } func (h *ProjectReconfigHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { @@ -107,13 +105,12 @@ func (h *ProjectReconfigHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques } type ProjectUpdateRepoLinkedAccountHandler struct { - log *zap.SugaredLogger - ah *action.ActionHandler - exposedURL string + log *zap.SugaredLogger + ah *action.ActionHandler } -func NewProjectUpdateRepoLinkedAccountHandler(logger *zap.Logger, ah *action.ActionHandler, exposedURL string) *ProjectUpdateRepoLinkedAccountHandler { - return &ProjectUpdateRepoLinkedAccountHandler{log: logger.Sugar(), ah: ah, exposedURL: exposedURL} +func NewProjectUpdateRepoLinkedAccountHandler(logger *zap.Logger, ah *action.ActionHandler) *ProjectUpdateRepoLinkedAccountHandler { + return &ProjectUpdateRepoLinkedAccountHandler{log: logger.Sugar(), ah: ah} } func (h *ProjectUpdateRepoLinkedAccountHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { diff --git a/internal/services/gateway/api/projectgroup.go b/internal/services/gateway/api/projectgroup.go index 2ff9c33..e3100a1 100644 --- a/internal/services/gateway/api/projectgroup.go +++ b/internal/services/gateway/api/projectgroup.go @@ -36,13 +36,12 @@ type CreateProjectGroupRequest struct { } type CreateProjectGroupHandler struct { - log *zap.SugaredLogger - ah *action.ActionHandler - exposedURL string + log *zap.SugaredLogger + ah *action.ActionHandler } -func NewCreateProjectGroupHandler(logger *zap.Logger, ah *action.ActionHandler, exposedURL string) *CreateProjectGroupHandler { - return &CreateProjectGroupHandler{log: logger.Sugar(), ah: ah, exposedURL: exposedURL} +func NewCreateProjectGroupHandler(logger *zap.Logger, ah *action.ActionHandler) *CreateProjectGroupHandler { + return &CreateProjectGroupHandler{log: logger.Sugar(), ah: ah} } func (h *CreateProjectGroupHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { diff --git a/internal/services/gateway/gateway.go b/internal/services/gateway/gateway.go index 5c4115f..09a960f 100644 --- a/internal/services/gateway/gateway.go +++ b/internal/services/gateway/gateway.go @@ -152,13 +152,13 @@ func (g *Gateway) Run(ctx context.Context) error { projectGroupHandler := api.NewProjectGroupHandler(logger, g.ah) projectGroupSubgroupsHandler := api.NewProjectGroupSubgroupsHandler(logger, g.ah) projectGroupProjectsHandler := api.NewProjectGroupProjectsHandler(logger, g.ah) - createProjectGroupHandler := api.NewCreateProjectGroupHandler(logger, g.ah, g.c.APIExposedURL) + createProjectGroupHandler := api.NewCreateProjectGroupHandler(logger, g.ah) projectHandler := api.NewProjectHandler(logger, g.ah) - createProjectHandler := api.NewCreateProjectHandler(logger, g.ah, g.c.APIExposedURL) + createProjectHandler := api.NewCreateProjectHandler(logger, g.ah) deleteProjectHandler := api.NewDeleteProjectHandler(logger, g.ah) - projectReconfigHandler := api.NewProjectReconfigHandler(logger, g.ah, g.c.APIExposedURL) - projectUpdateRepoLinkedAccountHandler := api.NewProjectUpdateRepoLinkedAccountHandler(logger, g.ah, g.c.APIExposedURL) + projectReconfigHandler := api.NewProjectReconfigHandler(logger, g.ah) + projectUpdateRepoLinkedAccountHandler := api.NewProjectUpdateRepoLinkedAccountHandler(logger, g.ah) secretHandler := api.NewSecretHandler(logger, g.ah) createSecretHandler := api.NewCreateSecretHandler(logger, g.ah)