rdev/internal/port/health.go
jordan 210064d490 feat: add diagnostics endpoint and external health monitoring
- Add /diagnostics endpoint for system health overview
- Add external health worker for monitoring Gitea, Woodpecker, Registry
- Add health check methods to Gitea and Woodpecker clients
- Remove hardcoded fallback projects (pantheon, aeries)
- Add diagnostics domain types and service layer
- Add comprehensive tests for diagnostics handler and service
- Fix tests to use registered test project instead of hardcoded one

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:10:56 -07:00

32 lines
861 B
Go

package port
import (
"context"
"github.com/orchard9/rdev/internal/domain"
)
// DatabasePinger checks database connectivity.
// *sql.DB satisfies this interface.
type DatabasePinger interface {
PingContext(ctx context.Context) error
}
// KubernetesChecker checks Kubernetes API connectivity.
type KubernetesChecker interface {
// ServerVersion returns the server version string, or an error if unreachable.
ServerVersion() (string, error)
}
// RegistryChecker checks container registry health.
type RegistryChecker interface {
// Check returns the health status of the registry.
Check(ctx context.Context) domain.RegistryStatus
}
// ExternalHealthChecker checks an external system's health.
type ExternalHealthChecker interface {
// Check returns the health status of the external system.
Check(ctx context.Context) domain.ExternalSystemStatus
}