health

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

README

Health

This package provides a health http endpoint (/health) that can be controlled by the use of a health.Service.

UseFiberEndpoint

The UseFiberEndpoint adds the /health route to your fiber app.

Service functions

  • IsHealthy checks a list of components if they are healthy. Returns false as soon as one of those components is unhealthy. If no component is specified, all available components will be checked.
  • SetHealthy defines the health status of a given component as "healthy".
  • SetUnhealthy defines the health status of a given component as "not healthy" and requires a reason.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseFiberEndpoint

func UseFiberEndpoint(options *UseFiberEndpointOptions)

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(logger golog.Logger, lifecycle *app.Lifecycle) *Service

func (*Service) IsHealthy

func (s *Service) IsHealthy(component ...string) (bool, string)

func (*Service) SetHealthy

func (s *Service) SetHealthy(component string)

func (*Service) SetUnhealthy

func (s *Service) SetUnhealthy(component string, reason string)

type UseFiberEndpointOptions

type UseFiberEndpointOptions struct {
	Fiber  *fiber.App
	Health *Service
}

func (*UseFiberEndpointOptions) Handle

func (o *UseFiberEndpointOptions) Handle(c *fiber.Ctx) error

Jump to

Keyboard shortcuts

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