This file contains 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
// aboutFilePath = path for the about file for metadata about service. | |
// Ussually hosted in project for developers / ops to edit. | |
// Sample at https://github.com/hootsuite/healthchecks/blob/master/test/about.json | |
aboutFilePath := "conf/about.json" | |
// versionFilePath = path for the version file for current version of running service. | |
// Ussually created at build / deploy time. | |
// Sample at https://github.com/hootsuite/healthchecks/blob/master/test/version.txt | |
versionFilePath := "conf/version.txt" |
This file contains 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
// Create a db object by opening the connection | |
db, err := sql.Open("mysql", "user:password@tcp(127.0.0.1:3306)/a-db") | |
if err != nil { | |
log.Fatal(err) | |
} | |
// Define a StatusEndpoint at '/status/db' for a database dependency | |
dbs := healthchecks.StatusEndpoint{ | |
Name: "The DB", | |
Slug: "db", |
This file contains 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
// Define a StatusEndpoint at '/status/db' for a database dependency | |
db := healthchecks.StatusEndpoint{ | |
Name: "The DB", | |
Slug: "db", | |
Type: "internal", | |
IsTraversable: false, | |
StatusCheck: sqlsc.SQLDBStatusChecker{ | |
DB: myDB | |
}, | |
TraverseCheck: nil, |