19 lines
324 B
Go
19 lines
324 B
Go
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)
|
|
}
|
|
}
|