readyness

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

README

Readyness

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

Initialization

app := fx.New(
	env.Module,
	logrus.Module,
	metrics.Module,
	fiber.Module,
	health.Module,
	func(service *readyness.ServiceReadyness) {
		// use service here
	},
)
app.Run()

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

View Source
var Module = fx.Options(
	fx.Provide(
		newServiceReadyness,
	),
	fx.Invoke(
		useReadynessEndpoint,
	),
)

Functions

This section is empty.

Types

type ReadynessEndpoint

type ReadynessEndpoint struct {
	fx.In

	Readyness *ServiceReadyness
}

func (*ReadynessEndpoint) Handle

func (e *ReadynessEndpoint) Handle(c *fiber.Ctx) error

type ServiceReadyness

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

func (*ServiceReadyness) IsReady

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

func (*ServiceReadyness) Register

func (s *ServiceReadyness) Register(component string)

func (*ServiceReadyness) SetReady

func (s *ServiceReadyness) SetReady(component string)

Jump to

Keyboard shortcuts

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