go get github.com/saintmalik/allgood
import (
"github.com/saintmalik/allgood"
"github.com/saintmalik/allgood/checks"
)
func main() {
engine := allgood.NewEngine()
redisClient, err := initializeRedis(redisurl)
if err != nil {
fmt.Println("Redis initialization failed")
}
// mongoClient := // your MongoDB client
// engine.SetCheck("MongoDB connection", allgood.CheckMongoConnection(mongoClient))
ref := // your Supabase project ref
apikey := // your Supabase apikey
engine.SetCheck("Supabase connection", allgood.CheckSupabaseConnection(ref, apikey))
// engine.SetCheck("Postgres connection", checks.CheckPostgresConnection(postgresPool))
engine.SetCheck("Redis connection", checks.CheckRedisConnection(redisClient))
engine.SetCheck("Disk space usage", checks.CheckDiskSpace(90))
engine.SetCheck("Memory usage", checks.CheckMemoryUsage(90))
engine.SetCheck("CPU usage", checks.CheckCPUUsage(90))
http.HandleFunc("/healthcheck", engine.HealthCheckHandler())
http.ListenAndServe(":8080", nil)
}
-
Notifications
You must be signed in to change notification settings - Fork 1
saintmalik/allgood
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
✅ Quickly set up a health check page for your Golang app
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published