mirror of
https://github.com/labstack/echo.git
synced 2024-11-24 08:22:21 +02:00
e7c89c424f
Signed-off-by: Vishal Rana <vr@labstack.com>
26 lines
516 B
Go
26 lines
516 B
Go
// +build go1.8
|
|
|
|
package echo
|
|
|
|
import (
|
|
stdContext "context"
|
|
)
|
|
|
|
// Close immediately stops the server.
|
|
// It internally calls `http.Server#Close()`.
|
|
func (e *Echo) Close() error {
|
|
if err := e.TLSServer.Close(); err != nil {
|
|
return err
|
|
}
|
|
return e.Server.Close()
|
|
}
|
|
|
|
// Shutdown stops server the gracefully.
|
|
// It internally calls `http.Server#Shutdown()`.
|
|
func (e *Echo) Shutdown(ctx stdContext.Context) error {
|
|
if err := e.TLSServer.Shutdown(ctx); err != nil {
|
|
return err
|
|
}
|
|
return e.Server.Shutdown(ctx)
|
|
}
|