Created
August 5, 2019 13:24
-
-
Save eranharel/87cc9ea075efb1cfec37e0bdd74ed8e1 to your computer and use it in GitHub Desktop.
go-sundheit regiester built-in DNS check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"time" | |
health "github.com/AppsFlyer/go-sundheit" | |
"github.com/AppsFlyer/go-sundheit/checks" | |
) | |
func registerHealthChecks() { | |
// create a new health instance | |
var h = health.New() | |
// Schedule a host resolution check for `example.com`, requiring at least one results, and running every 10 sec | |
h.RegisterCheck(&health.Config{ | |
Check: checks.NewResolveCheck("example.com", 200*time.Millisecond, 1), | |
ExecutionPeriod: 10 * time.Second, | |
}) | |
// schedule more checks... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment