mirror of
				https://github.com/steveiliop56/tinyauth.git
				synced 2025-11-04 08:05:42 +00:00 
			
		
		
		
	* refactor: don't export non-needed fields * feat: coderabbit suggestions * fix: avoid queries panic
		
			
				
	
	
		
			26 lines
		
	
	
		
			548 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			548 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package controller
 | 
						|
 | 
						|
import "github.com/gin-gonic/gin"
 | 
						|
 | 
						|
type HealthController struct {
 | 
						|
	router *gin.RouterGroup
 | 
						|
}
 | 
						|
 | 
						|
func NewHealthController(router *gin.RouterGroup) *HealthController {
 | 
						|
	return &HealthController{
 | 
						|
		router: router,
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
func (controller *HealthController) SetupRoutes() {
 | 
						|
	controller.router.GET("/health", controller.healthHandler)
 | 
						|
	controller.router.HEAD("/health", controller.healthHandler)
 | 
						|
}
 | 
						|
 | 
						|
func (controller *HealthController) healthHandler(c *gin.Context) {
 | 
						|
	c.JSON(200, gin.H{
 | 
						|
		"status":  "ok",
 | 
						|
		"message": "Healthy",
 | 
						|
	})
 | 
						|
}
 |