healthcheck

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthChecker

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

HealthChecker is responsible for checking the health of upstream caches.

func New

func New() *HealthChecker

New creates a new HealthChecker.

func (*HealthChecker) AddUpstreams

func (hc *HealthChecker) AddUpstreams(upstreams []*upstream.Cache)

AddUpstream adds a new upstream cache to monitor.

func (*HealthChecker) RemoveUpstream

func (hc *HealthChecker) RemoveUpstream(upstream *upstream.Cache)

RemoveUpstream removes an upstream cache from monitoring.

func (*HealthChecker) SetHealthChangeNotifier

func (hc *HealthChecker) SetHealthChangeNotifier(ch chan<- HealthStatusChange)

SetHealthChangeNotifier sets the channel to notify about health status changes.

func (*HealthChecker) Start

func (hc *HealthChecker) Start(ctx context.Context)

Start starts the health checker.

func (*HealthChecker) Trigger

func (hc *HealthChecker) Trigger() chan struct{}

Trigger forces the health check to run now.

type HealthStatusChange

type HealthStatusChange struct {
	Upstream  *upstream.Cache
	IsHealthy bool
}

HealthStatusChange represents a change in upstream health status.

Jump to

Keyboard shortcuts

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