Documentation
¶
Overview ¶
Package server runs a Fiber app with signal-based graceful shutdown.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶ added in v1.2.0
type Config struct {
Timeout time.Duration
DrainDelay time.Duration
PreShutdown []func(ctx context.Context) error
Cleanup []func(ctx context.Context) error
}
Config tunes graceful shutdown. Timeout bounds the whole shutdown sequence. PreShutdown hooks run before the server stops accepting connections (e.g. to flip a readiness gate); DrainDelay then waits so a load balancer can stop routing before in-flight connections are closed; Cleanup hooks run after the server has shut down.
Click to show internal directories.
Click to hide internal directories.