readyness

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: 4 Imported by: 0

README

Readyness

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

UseFiberEndpoint

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

Service functions

  • IsReady checks a list of components if they are ready. Returns false as soon as one of those components is not ready. If no component is specified, all available components will be checked.
  • SetReady defines the ready status of a given component as "ready".
  • Register registers a new component as not ready.

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) *Service

func (*Service) IsReady

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

func (*Service) Register

func (s *Service) Register(component string)

func (*Service) SetReady

func (s *Service) SetReady(component string)

type UseFiberEndpointOptions

type UseFiberEndpointOptions struct {
	Fiber     *fiber.App
	Readyness *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