health

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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.

Jump to

Keyboard shortcuts

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