add healts check to common

This commit is contained in:
Pavel 2024-03-13 19:43:12 +03:00
parent 44b37825e8
commit 4560248259

@ -0,0 +1,18 @@
package healthchecks
import (
"github.com/gofiber/fiber/v2"
)
func Liveness(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK)
}
func Readiness(err *error) fiber.Handler {
return func(c *fiber.Ctx) error {
if *err != nil {
return c.SendString((*err).Error())
}
return c.SendStatus(fiber.StatusOK)
}
}