Commit: Bulk unfinished work

This commit is contained in:
2026-01-22 17:39:04 +01:00
parent 6c46b4efcc
commit 3a9acc42a2
68 changed files with 5047 additions and 1064 deletions

26
utils/healthcheck.go Normal file
View File

@@ -0,0 +1,26 @@
package utils
// Keep (used in cmd/api/main.go)
// Healthcheck utilities for gRPC services
// using connect-go and grpchealth
import (
"connectrpc.com/grpchealth"
"git.kocoder.xyz/kocoded/vt/fx"
"git.kocoder.xyz/kocoded/vt/gen/project/v1/projectv1connect"
"git.kocoder.xyz/kocoded/vt/gen/todo/v1/todov1connect"
)
func NewHealthchecker() grpchealth.Checker {
checker := grpchealth.NewStaticChecker()
checker.SetStatus(projectv1connect.ProjectServiceName, grpchealth.StatusServing)
checker.SetStatus(todov1connect.TodoServiceName, grpchealth.StatusServing)
return checker
}
func NewHealthCheckV1(healthChecker grpchealth.Checker) fx.Handler {
path, handler := grpchealth.NewHandler(healthChecker)
return fx.NewRoute(path, handler)
}