healthchecker

package
v0.3.36 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedHealthChecker

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

AggregatedHealthChecker is a health checker that aggregates the results of multiple health checkers. If any of the health checkers return an error or unhealthy status, the AggregatedHealthChecker will

func NewAggregatedHealthChecker

func NewAggregatedHealthChecker() *AggregatedHealthChecker

NewAggregatedHealthChecker creates a new AggregatedHealthChecker.

func (*AggregatedHealthChecker) Register

func (ahc *AggregatedHealthChecker) Register(name string, checker HealthChecker)

Register adds a new health checker to the AggregatedHealthChecker.

func (*AggregatedHealthChecker) ServeHTTP

func (ahc *AggregatedHealthChecker) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface for the AggregatedHealthChecker.

func (*AggregatedHealthChecker) Start

func (ahc *AggregatedHealthChecker) Start(ctx context.Context, port int)

Start starts the AggregatedHealthChecker on the specified port.

func (*AggregatedHealthChecker) Unregister

func (ahc *AggregatedHealthChecker) Unregister(name string)

Unregister removes a health checker from the AggregatedHealthChecker.

type HealthChecker

type HealthChecker interface {
	Check(ctx context.Context) (bool, error)
}

HealthChecker is an interface for health checkers that can be used to check the health of a system or service.

Jump to

Keyboard shortcuts

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