type

ServerOptions

Socket timeouts, graceful drain, and readiness admission.

Example

go
options := ridu.ServerOptions{
  ReadHeaderTimeout:   10 * time.Second,
  ShutdownTimeout:     20 * time.Second,
  WorkerDrainTimeout:  30 * time.Second,
  ReadinessDrainDelay: 5 * time.Second,
}

Properties

PropertyTypeDescription
ReadHeaderTimeouttime.DurationBounds request-header reads.
ReadTimeouttime.DurationBounds complete request reads.
WriteTimeouttime.DurationBounds response writes.
IdleTimeouttime.DurationBounds idle keep-alive connections.
MaxHeaderBytesintLimits request-header bytes.
ShutdownTimeouttime.DurationBounds HTTP shutdown.
WorkerDrainTimeouttime.DurationBounds background worker drain.
ReadinessDrainDelaytime.DurationKeeps the listener alive briefly after readiness becomes false.
AllowUnverifiableReadinessboolPermits custom adapters that cannot report readiness.
SkipReadinessPreflightboolLets a development listener bind before dependency verification.

How it works

Zero values use conservative defaults. Negative socket timeouts disable that individual bound; non-positive shutdown and worker-drain timeouts still use bounded defaults.

WithServerOptions installs one complete value into Execute. Socket timeouts accept negative values to disable an individual bound; shutdown and worker-drain timeouts remain bounded at 15 seconds when non-positive.

AllowUnverifiableReadiness and SkipReadinessPreflight are explicit escape hatches, not general production defaults. Official adapters implement the readiness contracts required by normal startup.

Full signature