health

package
v1.33.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatastoreChecker

type DatastoreChecker interface {
	// ReadyState returns whether the datastore is ready to be used.
	ReadyState(ctx context.Context) (datastore.ReadyState, error)
}

DatastoreChecker is an interface for determining if the datastore is ready for traffic.

type Manager

type Manager interface {
	// RegisterReportedService registers the name of service under the same server
	// for whom the health is being managed by this manager.
	RegisterReportedService(serviceName string)

	// HealthSvc is the health service this manager is managing.
	HealthSvc() *grpcutil.AuthlessHealthServer

	// Checker returns a function that can be run via an errgroup to perform the health checks.
	Checker(ctx context.Context) func() error
}

Manager is a system which manages the health service statuses.

func NewHealthManager

func NewHealthManager(dispatcher dispatch.Dispatcher, dsc DatastoreChecker) Manager

NewHealthManager creates and returns a new health manager that checks the IsReady status of the given dispatcher and datastore checker and sets the health check to return healthy once both have gone to true.

Jump to

Keyboard shortcuts

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