Documentation ¶
Index ¶
Constants ¶
const AppName = "health"
Variables ¶
This section is empty.
Functions ¶
func NewHealthCheckRequest ¶
func NewHealthCheckRequest() *healthgrpc.HealthCheckRequest
NewHealthCheckRequest returns a new health check request.
Types ¶
type HealthCheckResponse ¶
type HealthCheckResponse struct {
Status string `json:"status"`
}
func NewHealthCheckResponse ¶
func NewHealthCheckResponse(h *healthgrpc.HealthCheckResponse) HealthCheckResponse
NewHealthCheckResponse creates a new HealthCheckResponse from a healthgrpc.HealthCheckResponse.
type HealthChecker ¶
type HealthChecker struct { HealthCheckerPath string // contains filtered or unexported fields }
func NewDefaultHealthChecker ¶
func NewDefaultHealthChecker() *HealthChecker
NewDefaultHealthChecker returns a new instance of HealthChecker with a default health server.
Returns a pointer to HealthChecker.
func NewHealthChecker ¶
func NewHealthChecker(service healthgrpc.HealthServer) *HealthChecker
NewHealthChecker returns a pointer to a HealthChecker instance, initialized with the provided service, default HealthCheckerPath, and a logger.
service: a grpc HealthServer implementation. Returns a pointer to a HealthChecker instance.
func (*HealthChecker) Check ¶
func (h *HealthChecker) Check(r *restful.Request, w *restful.Response)
Check is a method of the HealthChecker struct that checks the health of a service.
It takes in two parameters, a pointer to a restful.Request and a pointer to a restful.Response.
func (*HealthChecker) WebService ¶
func (h *HealthChecker) WebService() *restful.WebService
WebService returns a pointer to a restful.WebService instance.
This method receives no parameters. It returns a *restful.WebService instance.