summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/labstack/echo/echo_go1.8.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/labstack/echo/echo_go1.8.go')
-rw-r--r--vendor/github.com/labstack/echo/echo_go1.8.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/github.com/labstack/echo/echo_go1.8.go b/vendor/github.com/labstack/echo/echo_go1.8.go
new file mode 100644
index 00000000..340bed70
--- /dev/null
+++ b/vendor/github.com/labstack/echo/echo_go1.8.go
@@ -0,0 +1,25 @@
+// +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)
+}