Documentation
¶
Overview ¶
Package health provides HTTP handlers for health check operations. It includes endpoints for monitoring application health and status.
Package health provides health check functionality for the application. This file includes cache health check endpoints.
Index ¶
Constants ¶
const ( HealthCheckPath = "/health-check" CacheHealthPath = "/cache/health" CacheStatsPath = "/cache/stats" FlushCachePath = "/cache/flush" )
HealthCheckPath is the path for health check endpoint
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheHealthAPI ¶ added in v1.3.0
type CacheHealthAPI struct {
// contains filtered or unexported fields
}
CacheHealthAPI provides cache health check endpoints
func NewCacheHealthAPI ¶ added in v1.3.0
func NewCacheHealthAPI(logger *logger.Logger, cache *cache.Cache) *CacheHealthAPI
NewCacheHealthAPI creates a new cache health API instance
func (*CacheHealthAPI) CacheHealth ¶ added in v1.3.0
func (h *CacheHealthAPI) CacheHealth(w http.ResponseWriter, r *http.Request)
CacheHealth checks if Redis cache is healthy
func (*CacheHealthAPI) CacheStats ¶ added in v1.3.0
func (h *CacheHealthAPI) CacheStats(w http.ResponseWriter, r *http.Request)
CacheStats returns cache statistics
func (*CacheHealthAPI) FlushCache ¶ added in v1.3.0
func (h *CacheHealthAPI) FlushCache(w http.ResponseWriter, r *http.Request)
FlushCache clears all cache data
func (*CacheHealthAPI) RegisterHandlers ¶ added in v1.3.0
func (h *CacheHealthAPI) RegisterHandlers(router *mux.Router)
RegisterHandlers registers the cache health check routes
type HealthAPI ¶
type HealthAPI struct {
// contains filtered or unexported fields
}
func NewHealthAPI ¶
func (*HealthAPI) HealthCheckAPIHandler ¶ added in v1.3.0
func (api *HealthAPI) HealthCheckAPIHandler(w http.ResponseWriter, r *http.Request)
HealthCheckAPIHandler godoc @Summary ping example @Description do ping @Tags HealthCheck @Accept json @Produce json @Success 200 {string} string "OK" @Router /api/health-check [get] HealthCheckAPIHandler handles HTTP requests for health check endpoints. It returns a simple OK response to indicate the service is running.