outerhealth

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attach

func Attach(r chi.Router, cfg *serverconf.ServerConfig, version string, probes func() ProbeConfig)

Attach mounts GET /health and GET /health/ready on r (supatype-server outer mux). probes is called on each scrape so health reflects dynamic route manifests.

func SelfBaseURLForRealtimeProbe

func SelfBaseURLForRealtimeProbe(override, mode, tlsDomain, apiHost, apiPort string) string

SelfBaseURLForRealtimeProbe returns the outer base URL used to GET /realtime/v1/health. override is SUPATYPE_HEALTH_SELF_BASE_URL when non-empty; otherwise standalone+TLS uses https://TLSDomain (and non-443 port when apiPort is set); else loopback http://... from apiHost/apiPort.

Types

type ProbeConfig

type ProbeConfig struct {
	PostgRESTURL     string
	GraphQLURL       string
	StorageLocalPath string
	StorageRemoteURL string
	DenoBaseURL      string
	RealtimeEnabled  bool
	// SelfBaseURL is this server's outer base (e.g. http://127.0.0.1:9999 or https://api.example.com)
	// used to GET /realtime/v1/health when RealtimeEnabled. Normally set by serve via SelfBaseURLForRealtimeProbe;
	// override with SUPATYPE_HEALTH_SELF_BASE_URL for exotic layouts.
	SelfBaseURL string
}

ProbeConfig lists optional upstreams for /health and /health/ready checks. Empty URLs mean that probe is skipped for readiness (except PostgREST, which must be reachable when URL is non-empty).

func ProbeConfigFrom

func ProbeConfigFrom(cfg *serverconf.ServerConfig, m *proxy.RouteManifest, denoBaseURL string) ProbeConfig

ProbeConfigFrom builds probe targets from a route manifest plus server config (same resolution rules as cmd/mux.go for static startup).

Jump to

Keyboard shortcuts

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