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 ¶
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).