feat: 完成基本的 model
This commit is contained in:
19
pkg/handler/healthz.go
Normal file
19
pkg/handler/healthz.go
Normal file
@ -0,0 +1,19 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
func Healthz(name, version string) fiber.Handler {
|
||||
start := time.Now()
|
||||
return func(c fiber.Ctx) error {
|
||||
return c.JSON(fiber.Map{
|
||||
"name": name,
|
||||
"version": version,
|
||||
"start_at": start,
|
||||
"uptime": time.Since(start).String(),
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user