proxyhealth

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module(
	"proxyhealth",
	fx.Provide(newChecker),
	fx.Provide(func(checker *Checker) Snapshotter { return checker }),
	fx.Invoke(startChecker),
)

Module wires the proxy health checker.

Functions

This section is empty.

Types

type CheckRecord

type CheckRecord struct {
	Timestamp          time.Time `json:"timestamp"`
	Success            bool      `json:"success"`
	TCPDurationMS      int64     `json:"tcp_duration_ms,omitempty"`
	ConnectDurationMS  int64     `json:"connect_duration_ms,omitempty"`
	ErrorPhase         string    `json:"error_phase,omitempty"`
	ErrorReason        string    `json:"error_reason,omitempty"`
	HTTPStatusCategory string    `json:"http_status_category,omitempty"`
}

CheckRecord captures a single proxy check result.

type Checker

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

Checker runs proxy health checks.

func (*Checker) HealthSummaries

func (c *Checker) HealthSummaries() []RouteHealthSummary

func (*Checker) IdentityMap

func (c *Checker) IdentityMap() []proxy.IdentityRecord

func (*Checker) RouteSummaries

func (c *Checker) RouteSummaries() []proxy.RouteSummary

func (*Checker) Start

func (c *Checker) Start()

func (*Checker) Stop

func (c *Checker) Stop()

type HealthState

type HealthState string

HealthState tracks proxy health state.

const (
	HealthStateDirect    HealthState = "direct"
	HealthStateHealthy   HealthState = "healthy"
	HealthStateUnhealthy HealthState = "unhealthy"
)

type RouteHealthSummary

type RouteHealthSummary struct {
	Route       proxy.RouteSummary `json:"route"`
	HealthState string             `json:"health_state"`
	LastCheck   *time.Time         `json:"last_check,omitempty"`
	LastSuccess *time.Time         `json:"last_success,omitempty"`
	History     []CheckRecord      `json:"history,omitempty"`
}

RouteHealthSummary reports health and recent checks for a route.

type Snapshotter

type Snapshotter interface {
	RouteSummaries() []proxy.RouteSummary
	HealthSummaries() []RouteHealthSummary
	IdentityMap() []proxy.IdentityRecord
}

Snapshotter exposes proxy health snapshots.

Jump to

Keyboard shortcuts

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