Documentation
¶
Overview ¶
Package runtime starts and stops the reference server's HTTP listeners and background workers.
Serve validates listener security, builds the configured application and runs it until cancellation or a serving failure. It supports configured certificate files and managed HTTPS identities. Plain HTTP is restricted to loopback; the DDM role additionally requires an explicit test option.
ServeListener uses the same lifecycle with a caller-bound listener, retaining an ephemeral port throughout application setup. It owns closing the listener, including on startup failure, and validates the actual bound address.
Shutdown stops HTTP admission and drains active requests before cancelling workers. A shared deadline bounds that drain, and workers that fail to stop are reported as an error. Serve closes the application resources it owns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrProbe = errors.New("health probe failed")
ErrProbe identifies invalid probe configuration or an unhealthy endpoint.
Functions ¶
func Probe ¶
func Probe(ctx context.Context, cfg ProbeConfig) error
Probe checks storage health with a two-second deadline, without redirects. Automatic probes do not use HTTP proxies. Certificate changes require the serving process to restart before its local certificate pin matches again.
func ServeListener ¶ added in v0.9.2
ServeListener serves an already-bound listener and closes it on every exit path. Embedded callers can retain an ephemeral port throughout application setup. Security checks use the listener's actual address rather than cfg.Listen.
Types ¶
type ProbeConfig ¶
type ProbeConfig struct {
Certificate *x509.Certificate
URL string
Listen string
TLSCertFile string
TLSKeyFile string
CAFile string
}
ProbeConfig selects an explicit URL or the process configuration with URL=auto. Automatic TLS checks trust and pin the configured certificate, independently of public DNS or the device-identity CA. CAFile is for explicit URL probes.