mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-06-14 07:20:15 +00:00
32 lines
595 B
Go
32 lines
595 B
Go
package controller
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"go.uber.org/dig"
|
|
)
|
|
|
|
type HealthController struct {
|
|
}
|
|
|
|
type HealthControllerInput struct {
|
|
dig.In
|
|
|
|
RouterGroup *gin.RouterGroup `name:"apiRouterGroup"`
|
|
}
|
|
|
|
func NewHealthController(i HealthControllerInput) *HealthController {
|
|
controller := &HealthController{}
|
|
|
|
i.RouterGroup.GET("/healthz", controller.healthHandler)
|
|
i.RouterGroup.HEAD("/healthz", controller.healthHandler)
|
|
|
|
return controller
|
|
}
|
|
|
|
func (controller *HealthController) healthHandler(c *gin.Context) {
|
|
c.JSON(200, gin.H{
|
|
"status": 200,
|
|
"message": "Healthy",
|
|
})
|
|
}
|