healthcheck

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure added in v0.11.0

func Configure(router gin.IRouter, client Client)

Configure configures router with a /healthz endpoint using a handler created with NewHandler.

func NewHandler

func NewHandler(client Client) gin.HandlerFunc

NewHandler returns a gin.HandlerFunc that provides a health check endpoint behavior. On each request it queries client.IsHealthy and returns a 200 if the backend is healthy, else a 500.

Types

type Client

type Client interface {
	// IsHealthy returns true if the backend is healthy, else false.
	IsHealthy(context.Context) bool
}

Client defines health check behavior for a service.

Jump to

Keyboard shortcuts

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