-
Notifications
You must be signed in to change notification settings - Fork 5
/
health.go
31 lines (26 loc) · 847 Bytes
/
health.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"krak8s/app"
"time"
"github.com/blang/semver"
"github.com/goadesign/goa"
)
// HealthController implements the health resource.
type HealthController struct {
*goa.Controller
}
// NewHealthController creates a health controller.
func NewHealthController(service *goa.Service) *HealthController {
return &HealthController{Controller: service.NewController("HealthController")}
}
// Health runs the health action.
func (c *HealthController) Health(ctx *app.HealthHealthContext) error {
// HealthController_Health: start_implement
ver := "unknown"
semVer, err := semver.Make(MajorMinorPatch + "-" + ReleaseType + "+git.sha." + GitCommit)
if err == nil {
ver = semVer.String()
}
return ctx.OK([]byte("Health OK: " + time.Now().String() + ", semVer: " + ver + "\n"))
// HealthController_Health: end_implement
}