healthcheck

package
v3.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultLivenessEndpoint  = "/livez"
	DefaultReadinessEndpoint = "/readyz"
)

Variables

This section is empty.

Functions

func NewHealthChecker

func NewHealthChecker(config ...Config) fiber.Handler

Types

type Config

type Config struct {
	// Next defines a function to skip this middleware when returned true. If this function returns true
	// and no other handlers are defined for the route, Fiber will return a status 404 Not Found, since
	// no other handlers were defined to return a different status.
	//
	// Optional. Default: nil
	Next func(fiber.Ctx) bool

	// Function used for checking the liveness of the application. Returns true if the application
	// is running and false if it is not. The liveness probe is typically used to indicate if
	// the application is in a state where it can handle requests (e.g., the server is up and running).
	//
	// Optional. Default: func(c fiber.Ctx) bool { return true }
	Probe HealthChecker
}

Config defines the configuration options for the healthcheck middleware.

type HealthChecker

type HealthChecker func(fiber.Ctx) bool

HealthChecker defines a function to check liveness or readiness of the application

Jump to

Keyboard shortcuts

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