Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler provides HTTP handlers for health checks
func NewHandler ¶
func NewHandler(sessionFactory db.SessionFactory) *Handler
NewHandler creates a new health handler
func (*Handler) LivenessHandler ¶
func (h *Handler) LivenessHandler(w http.ResponseWriter, r *http.Request)
LivenessHandler handles the /healthz endpoint Returns 200 OK if the application is alive
func (*Handler) ReadinessHandler ¶
func (h *Handler) ReadinessHandler(w http.ResponseWriter, r *http.Request)
ReadinessHandler handles the /readyz endpoint Returns 200 OK if the application is ready to receive traffic Returns 503 Service Unavailable if the application is shutting down or not ready
type ReadinessState ¶
type ReadinessState struct {
// contains filtered or unexported fields
}
ReadinessState represents the current readiness state of the application
func GetReadinessState ¶
func GetReadinessState() *ReadinessState
GetReadinessState returns the singleton ReadinessState instance
func (*ReadinessState) IsReady ¶
func (r *ReadinessState) IsReady() bool
IsReady returns true if the application is ready and not shutting down
func (*ReadinessState) IsShuttingDown ¶
func (r *ReadinessState) IsShuttingDown() bool
IsShuttingDown returns true if the application is shutting down
func (*ReadinessState) SetReady ¶
func (r *ReadinessState) SetReady()
SetReady marks the application as ready to receive traffic
func (*ReadinessState) SetShuttingDown ¶
func (r *ReadinessState) SetShuttingDown()
SetShuttingDown marks the application as shutting down This will cause the readiness check to fail, signaling to Kubernetes to stop routing traffic to this instance