Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthRoutes ¶
func HealthRoutes(r chi.Router)
HealthRoutes defines the routes for the health checks
Types ¶
type HealthHandler ¶
type HealthHandler struct {
// contains filtered or unexported fields
}
HealthHandler is a struct that holds a reference to the HealthStore.
func NewHealthHandler ¶
func NewHealthHandler(s HealthStore) *HealthHandler
NewHealthHandler creates and returns a new instance of HealthHandler.
func (*HealthHandler) GetDatabaseHealth ¶
func (h *HealthHandler) GetDatabaseHealth(w http.ResponseWriter, r *http.Request)
GetDatabaseHealth handles the health check for the database by calling the corresponding method.
func (*HealthHandler) GetRouterHealth ¶
func (h *HealthHandler) GetRouterHealth(w http.ResponseWriter, r *http.Request)
GetRouterHealth handles the health check for the router by calling the corresponding method.
type HealthStore ¶
type HealthStore interface { // GetRouterHealth handles the health check for the router. GetRouterHealth(w http.ResponseWriter, r *http.Request) // GetDatabaseHealth handles the health check for the database. GetDatabaseHealth(w http.ResponseWriter, r *http.Request) }
HealthStore defines the contract for a health check store.
func NewHealthStore ¶
func NewHealthStore() HealthStore
NewHealthStore creates a new instance of healthStore, implementing the HealthStore interface.
Click to show internal directories.
Click to hide internal directories.