TRA-4263 extensibility refactor (#770)

* Refactor routers

* refactor extension loading

* refactor server creation code

* Update main.go
This commit is contained in:
RamiBerm
2022-02-08 14:59:56 +02:00
committed by GitHub
parent f013b0f03c
commit 0a4674ea7c
13 changed files with 450 additions and 307 deletions

View File

@@ -6,9 +6,15 @@ import (
"github.com/gin-gonic/gin"
)
var (
MetadataGetVersionHandler = controllers.GetVersion
)
// MetadataRoutes defines the group of metadata routes.
func MetadataRoutes(app *gin.Engine) {
func MetadataRoutes(app *gin.Engine) *gin.RouterGroup {
routeGroup := app.Group("/metadata")
routeGroup.GET("/version", controllers.GetVersion)
routeGroup.GET("/version", func(c *gin.Context) { MetadataGetVersionHandler(c) })
return routeGroup
}