From acfb2cda8bc5f60a0ede71d2d9fdd0561b1c6d6e Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Mon, 20 Nov 2023 14:14:00 -0500 Subject: [PATCH 1/2] =?UTF-8?q?refactor!:=20renommer=20package=20api=5Fhan?= =?UTF-8?q?dlers=20=C3=A0=20apihandler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKING: package api_handlers renommé pour apihandler --- Dockerfile | 2 +- api_handlers/api_handlers.go => apihandler/apihandler.go | 2 +- cmd/server.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename api_handlers/api_handlers.go => apihandler/apihandler.go (99%) diff --git a/Dockerfile b/Dockerfile index 9899c40..3384d3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ ADD cmd/ cmd/ ADD api/ api/ -ADD api_handlers/ api_handlers/ +ADD apihandler/ apihandler/ ADD apiresponse/ apiresponse/ diff --git a/api_handlers/api_handlers.go b/apihandler/apihandler.go similarity index 99% rename from api_handlers/api_handlers.go rename to apihandler/apihandler.go index 21ddb63..d3d170f 100644 --- a/api_handlers/api_handlers.go +++ b/apihandler/apihandler.go @@ -1,4 +1,4 @@ -package api_handlers +package apihandler import ( "context" diff --git a/cmd/server.go b/cmd/server.go index 47c61f0..8be7e00 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -18,7 +18,7 @@ import ( "github.com/spf13/viper" "git.agecem.com/agecem/agecem-org/api" - "git.agecem.com/agecem/agecem-org/api_handlers" + "git.agecem.com/agecem/agecem-org/apihandler" "git.agecem.com/agecem/agecem-org/config" "git.agecem.com/agecem/agecem-org/media" "git.agecem.com/agecem/agecem-org/public" @@ -205,7 +205,7 @@ func RunServer() { log.Fatal("Error during NewMediaClientFromViper for API handlers") } - v1Handler := api_handlers.V1Handler{ + v1Handler := apihandler.V1Handler{ Config: cfg, MediaClient: mediaClient, } -- 2.45.2 From 5f85d3d55b325bcf130eaa975e237503aac7bc03 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Mon, 20 Nov 2023 14:19:59 -0500 Subject: [PATCH 2/2] =?UTF-8?q?refactor!:=20renommer=20package=20web=5Fhan?= =?UTF-8?q?dlers=20=C3=A0=20webhandler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pour suivre les naming conventions de go BREAKING: renommer package `web_handlers` à `webhandler` --- Dockerfile | 2 +- cmd/server.go | 20 +++++++++---------- .../webhandler.go | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) rename web_handlers/web_handlers.go => webhandler/webhandler.go (99%) diff --git a/Dockerfile b/Dockerfile index 3384d3a..3b53c4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ ADD templates/ templates/ ADD version/ version/ -ADD web_handlers/ web_handlers/ +ADD webhandler/ webhandler/ Add webresponse/ webresponse/ diff --git a/cmd/server.go b/cmd/server.go index 8be7e00..1380154 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -23,7 +23,7 @@ import ( "git.agecem.com/agecem/agecem-org/media" "git.agecem.com/agecem/agecem-org/public" "git.agecem.com/agecem/agecem-org/templates" - "git.agecem.com/agecem/agecem-org/web_handlers" + "git.agecem.com/agecem/agecem-org/webhandler" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" ) @@ -235,25 +235,25 @@ func RunServer() { log.Fatal(err) } - webHandler := web_handlers.WebHandler{ + webHandler := webhandler.WebHandler{ ApiClient: apiClient, } - e.GET("/", web_handlers.HandleIndex) + e.GET("/", webhandler.HandleIndex) - //e.GET("/a-propos", web_handlers.HandleAPropos) + //e.GET("/a-propos", webhandler.HandleAPropos) - //e.GET("/actualite", web_handlers.HandleActualite) + //e.GET("/actualite", webhandler.HandleActualite) - //e.GET("/actualite/:article", web_handlers.HandleActualiteArticle) + //e.GET("/actualite/:article", webhandler.HandleActualiteArticle) - e.GET("/vie-etudiante", web_handlers.HandleVieEtudiante) + e.GET("/vie-etudiante", webhandler.HandleVieEtudiante) - e.GET("/vie-etudiante/:organisme", web_handlers.HandleVieEtudianteOrganisme) + e.GET("/vie-etudiante/:organisme", webhandler.HandleVieEtudianteOrganisme) e.GET("/documentation", webHandler.HandleDocumentation) - e.GET("/formulaires", web_handlers.HandleFormulaires) + e.GET("/formulaires", webhandler.HandleFormulaires) // Public Routes @@ -261,7 +261,7 @@ func RunServer() { // Admin Routes - groupAdmin.GET("", web_handlers.HandleAdmin) + groupAdmin.GET("", webhandler.HandleAdmin) groupAdmin.GET("/documents/upload", webHandler.HandleAdminDocumentsUpload) diff --git a/web_handlers/web_handlers.go b/webhandler/webhandler.go similarity index 99% rename from web_handlers/web_handlers.go rename to webhandler/webhandler.go index 293666e..cec2667 100644 --- a/web_handlers/web_handlers.go +++ b/webhandler/webhandler.go @@ -1,4 +1,4 @@ -package web_handlers +package webhandler import ( "fmt" -- 2.45.2