health

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HealthCheckTypeHTTP = "http"
	HealthCheckTypeTCP  = "tcp"
)

Supported health check types

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

Checker periodically checks the health of backends in registered ServerPools.

func NewChecker

func NewChecker(interval, timeout time.Duration, logger *zap.Logger, prefix string) *Checker

creates a new health checker with the given interval and timeout.

func (*Checker) RegisterPool

func (c *Checker) RegisterPool(p *pool.ServerPool)

func (*Checker) Start

func (c *Checker) Start(ctx context.Context)

begins the health checking process.

func (*Checker) Stop

func (c *Checker) Stop()

gracefully stops the health checker.

Jump to

Keyboard shortcuts

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