You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
500 B

package main
import (
"github.com/heptiolabs/healthcheck"
"time"
)
// createHealthChecks will create the readiness and liveness endpoints and add the check functions.
func createHealthChecks(gatewayUrl string) healthcheck.Handler {
health := healthcheck.NewHandler()
health.AddReadinessCheck("FRITZ!Box connection",
healthcheck.HTTPGetCheck(gatewayUrl+"/any.xml", time.Duration(3)*time.Second))
health.AddLivenessCheck("go-routines", healthcheck.GoroutineCountCheck(100))
return health
}