Skip to content

✅ Quickly set up a health check page for your Golang app

Notifications You must be signed in to change notification settings

saintmalik/allgood

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

allgood

allgood

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)
}

About

✅ Quickly set up a health check page for your Golang app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published