Shutdown gracefully shuts down the server without interrupting any active connections. It uses http.Server.Shutdown() and has the same functionality.
(ctx context.Context)
| 679 | // Shutdown gracefully shuts down the server without interrupting any active |
| 680 | // connections. It uses http.Server.Shutdown() and has the same functionality. |
| 681 | func (s *Server) Shutdown(ctx context.Context) error { |
| 682 | s.logger.DebugContext(ctx, "shutting down the server.") |
| 683 | return s.srv.Shutdown(ctx) |
| 684 | } |
| 685 | |
| 686 | func (s *Server) Addr() string { |
| 687 | return s.listener.Addr().String() |