Files
contracts/observability/checkable.go
T

18 lines
765 B
Go
Raw Permalink Normal View History

package observability
import "context"
// Checkable is the interface implemented by infrastructure components that report
// their health status to a health handler. Pass Checkable components to the web
// starter's health handler — the handler calls each concurrently with a deadline.
type Checkable interface {
// HealthCheck performs a connectivity or liveness probe for the component.
// Returns nil when the component is healthy, a non-nil error otherwise.
// Implementations must respect ctx cancellation and return promptly on timeout.
HealthCheck(ctx context.Context) error
// Name returns the component's display name used in health check responses.
Name() string
// Priority returns the criticality level of this component.
Priority() Level
}