Healthcheck helper for Gin to be able to easily got health checked thoroughly by Consul
Download and install it:
go get github.com/JesusIslam/healthcheck
Import it in your code:
import "github.com/JesusIslam/healthcheck
Simplest default example:
package main
import (
"time"
"github.com/JesusIslam/healthcheck"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
timeout := 15 * time.Second
h := healthcheck.New(nil, "myauthtoken", timeout)
r.GET("/health", h.Handle)
r.Run(":8080")
}