Documentation ¶
Overview ¶
Package shutdown provides a graceful shutdown mechanism.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GracefulShutdown ¶
func GracefulShutdown(ctx context.Context, opts ...OptionFunc)
GracefulShutdown gracefully shutdown the server. 1. tell the load balancer this node is offline, and stop sending new requests 2. set the healthcheck status to unhealthy 3. stop accepting new HTTP requests and wait for existing HTTP requests to finish 4. flushing any buffered log entries
Types ¶
type OptionFunc ¶
OptionFunc is a function that can be used to configure a graceful shutdown.
func HTTPServerShutdown ¶
func HTTPServerShutdown(httpServer *http.Server) OptionFunc
HTTPServerShutdown shutdown the HTTP server.
func HandlerShutdown ¶
func HandlerShutdown(handler *turl.Handler) OptionFunc
HandlerShutdown shutdown the handler.
Click to show internal directories.
Click to hide internal directories.