type
ServerOptions
Socket timeouts, graceful drain, and readiness admission.
Example
options := ridu.ServerOptions{
ReadHeaderTimeout: 10 * time.Second,
ShutdownTimeout: 20 * time.Second,
WorkerDrainTimeout: 30 * time.Second,
ReadinessDrainDelay: 5 * time.Second,
}Properties
| Property | Type | Description |
|---|---|---|
ReadHeaderTimeout | time.Duration | Bounds request-header reads. |
ReadTimeout | time.Duration | Bounds complete request reads. |
WriteTimeout | time.Duration | Bounds response writes. |
IdleTimeout | time.Duration | Bounds idle keep-alive connections. |
MaxHeaderBytes | int | Limits request-header bytes. |
ShutdownTimeout | time.Duration | Bounds HTTP shutdown. |
WorkerDrainTimeout | time.Duration | Bounds background worker drain. |
ReadinessDrainDelay | time.Duration | Keeps the listener alive briefly after readiness becomes false. |
AllowUnverifiableReadiness | bool | Permits custom adapters that cannot report readiness. |
SkipReadinessPreflight | bool | Lets 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.