health

package
v0.0.0-...-8699099 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL