From ceee8ec6b4d93e8fcdb673a77028fffbf9a88424 Mon Sep 17 00:00:00 2001 From: Varakh Date: Thu, 25 Jan 2024 00:08:26 +0100 Subject: [PATCH] Minor method renaming --- server/api_handler_health.go | 2 +- server/api_handler_info.go | 2 +- server/api_handler_webhook_invocation.go | 2 +- server/app.go | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/api_handler_health.go b/server/api_handler_health.go index 16d54a1..ce04707 100644 --- a/server/api_handler_health.go +++ b/server/api_handler_health.go @@ -13,7 +13,7 @@ func newHealthHandler() *healthHandler { return &healthHandler{} } -func (h *healthHandler) showHealth(c *gin.Context) { +func (h *healthHandler) show(c *gin.Context) { c.JSON(http.StatusOK, api.DataResponse{Data: gin.H{ "healthy": true, }}) diff --git a/server/api_handler_info.go b/server/api_handler_info.go index fc2a744..dc88654 100644 --- a/server/api_handler_info.go +++ b/server/api_handler_info.go @@ -14,7 +14,7 @@ func newInfoHandler(a *appConfig) *infoHandler { return &infoHandler{appConfig: *a} } -func (h *infoHandler) showInfo(c *gin.Context) { +func (h *infoHandler) show(c *gin.Context) { c.JSON(http.StatusOK, api.DataResponse{Data: gin.H{ "name": Name, "version": Version, diff --git a/server/api_handler_webhook_invocation.go b/server/api_handler_webhook_invocation.go index c77501f..c73bdf8 100644 --- a/server/api_handler_webhook_invocation.go +++ b/server/api_handler_webhook_invocation.go @@ -16,7 +16,7 @@ func newWebhookInvocationHandler(i *webhookInvocationService, w *webhookService) return &webhookInvocationHandler{invocationService: *i, webhookService: *w} } -func (h *webhookInvocationHandler) executeWebhookGeneric(c *gin.Context) { +func (h *webhookInvocationHandler) execute(c *gin.Context) { tokenHeader := c.GetHeader(HeaderWebhookToken) webhookId := c.Param("id") diff --git a/server/app.go b/server/app.go index 8ea77b4..6fb3538 100644 --- a/server/app.go +++ b/server/app.go @@ -79,10 +79,10 @@ func Start() { })) apiPublicGroup := router.Group("/api/v1") - apiPublicGroup.GET("/health", healthHandler.showHealth) - apiPublicGroup.GET("/info", infoHandler.showInfo) + apiPublicGroup.GET("/health", healthHandler.show) + apiPublicGroup.GET("/info", infoHandler.show) - apiPublicGroup.POST("/webhooks/:id", webhookInvocationHandler.executeWebhookGeneric) + apiPublicGroup.POST("/webhooks/:id", webhookInvocationHandler.execute) apiAuthGroup := router.Group("/api/v1", gin.BasicAuth(gin.Accounts{ env.authConfig.adminUser: env.authConfig.adminPassword,