Documentation
¶
Index ¶
- Constants
- func EnforceRuntimePolicy(goos string, logger *log.Logger) error
- func ListenUnixSocket(path string) (net.Listener, error)
- func MetricsHandler(pool *herd.Pool[*http.Client]) http.Handler
- func NewControlPlaneHandler(pool *herd.Pool[*http.Client], lifecycleManager *lifecycle.Manager, ...) http.Handler
- func NewDataPlaneHandler(pool *herd.Pool[*http.Client], lm *lifecycle.Manager, metricsPath string) http.Handler
- func RecordAcquireFailure()
- func RecordAcquireRequest()
- func RecordSessionDraining()
- func RecordSessionKilled()
- func RecordSessionResumed()
- func RecordSessionStarted()
- func RemoveUnixSocket(path string) error
- type ControlPlaneHandler
- type EventLogger
- type LifecycleSnapshot
- type SessionCreateRequest
- type SessionCreateResponse
Constants ¶
const SessionHeader = "X-Session-ID"
Variables ¶
This section is empty.
Functions ¶
func EnforceRuntimePolicy ¶
EnforceRuntimePolicy validates platform support and emits guarantee warnings. Linux runs with full guarantees. macOS is supported in reduced-guarantee mode. Other operating systems fail fast at startup.
func ListenUnixSocket ¶
ListenUnixSocket creates a UDS listener for the control plane. It removes stale socket files before binding and applies owner-only perms.
func MetricsHandler ¶
MetricsHandler exposes a small Prometheus-compatible text endpoint.
func NewControlPlaneHandler ¶ added in v0.5.0
func NewDataPlaneHandler ¶
func NewDataPlaneHandler(pool *herd.Pool[*http.Client], lm *lifecycle.Manager, metricsPath string) http.Handler
NewDataPlaneHandler builds the HTTP data-plane mux. - Proxy traffic is routed by X-Session-ID to session-affine workers. - /healthz reports daemon liveness. - telemetry metrics are exposed at metricsPath.
func RecordAcquireFailure ¶
func RecordAcquireFailure()
func RecordAcquireRequest ¶
func RecordAcquireRequest()
func RecordSessionDraining ¶ added in v0.5.0
func RecordSessionDraining()
func RecordSessionKilled ¶
func RecordSessionKilled()
func RecordSessionResumed ¶ added in v0.5.0
func RecordSessionResumed()
func RecordSessionStarted ¶
func RecordSessionStarted()
func RemoveUnixSocket ¶
RemoveUnixSocket removes a control-plane UDS file if it exists.
Types ¶
type ControlPlaneHandler ¶ added in v0.5.0
type ControlPlaneHandler struct {
// contains filtered or unexported fields
}
type EventLogger ¶
type EventLogger struct {
// contains filtered or unexported fields
}
func NewEventLogger ¶
func NewEventLogger(format string, logger *log.Logger) *EventLogger
type LifecycleSnapshot ¶
type LifecycleSnapshot struct {
AcquireRequests uint64
AcquireFailures uint64
SessionsStarted uint64
SessionsKilled uint64
SessionsDraining int64 // current sessions in grace period (gauge)
}
func SnapshotLifecycleCounters ¶
func SnapshotLifecycleCounters() LifecycleSnapshot
type SessionCreateRequest ¶ added in v0.5.0
type SessionCreateRequest struct {
Image string `json:"image"`
Command []string `json:"command,omitempty"`
Env map[string]string `json:"env,omitempty"`
IdleTimeoutSeconds int `json:"idle_timeout_seconds,omitempty"`
TTLSeconds int `json:"ttl_seconds,omitempty"`
HealthInterval string `json:"health_interval,omitempty"`
Warm bool `json:"warm,omitempty"`
}
SessionCreateRequest is the JSON body for POST /v1/sessions It acts as the TenantDeploymentConfig.
type SessionCreateResponse ¶ added in v0.5.0
type SessionCreateResponse struct {
SessionID string `json:"session_id"`
InternalIP string `json:"internal_ip"`
ProxyAddress string `json:"proxy_address"`
}
SessionCreateResponse is the JSON response