From 3a183cb218c6812964a70d2e75884ad7071d9c0c Mon Sep 17 00:00:00 2001 From: Wim Date: Tue, 6 Jun 2017 00:01:05 +0200 Subject: Update vendor --- .../echo/cookbook/google-app-engine/app-engine.go | 17 ------- .../echo/cookbook/google-app-engine/app-managed.go | 25 ---------- .../cookbook/google-app-engine/app-standalone.go | 24 ---------- .../echo/cookbook/google-app-engine/app.go | 4 -- .../echo/cookbook/google-app-engine/users.go | 54 ---------------------- .../echo/cookbook/google-app-engine/welcome.go | 31 ------------- 6 files changed, 155 deletions(-) delete mode 100644 vendor/github.com/labstack/echo/cookbook/google-app-engine/app-engine.go delete mode 100644 vendor/github.com/labstack/echo/cookbook/google-app-engine/app-managed.go delete mode 100644 vendor/github.com/labstack/echo/cookbook/google-app-engine/app-standalone.go delete mode 100644 vendor/github.com/labstack/echo/cookbook/google-app-engine/app.go delete mode 100644 vendor/github.com/labstack/echo/cookbook/google-app-engine/users.go delete mode 100644 vendor/github.com/labstack/echo/cookbook/google-app-engine/welcome.go (limited to 'vendor/github.com/labstack/echo/cookbook/google-app-engine') diff --git a/vendor/github.com/labstack/echo/cookbook/google-app-engine/app-engine.go b/vendor/github.com/labstack/echo/cookbook/google-app-engine/app-engine.go deleted file mode 100644 index 0c1db087..00000000 --- a/vendor/github.com/labstack/echo/cookbook/google-app-engine/app-engine.go +++ /dev/null @@ -1,17 +0,0 @@ -// +build appengine - -package main - -import ( - "net/http" - - "github.com/labstack/echo" -) - -func createMux() *echo.Echo { - e := echo.New() - // note: we don't need to provide the middleware or static handlers, that's taken care of by the platform - // app engine has it's own "main" wrapper - we just need to hook echo into the default handler - http.Handle("/", e) - return e -} diff --git a/vendor/github.com/labstack/echo/cookbook/google-app-engine/app-managed.go b/vendor/github.com/labstack/echo/cookbook/google-app-engine/app-managed.go deleted file mode 100644 index 7b8eacf8..00000000 --- a/vendor/github.com/labstack/echo/cookbook/google-app-engine/app-managed.go +++ /dev/null @@ -1,25 +0,0 @@ -// +build appenginevm - -package main - -import ( - "net/http" - - "github.com/labstack/echo" - "google.golang.org/appengine" -) - -func createMux() *echo.Echo { - e := echo.New() - // note: we don't need to provide the middleware or static handlers - // for the appengine vm version - that's taken care of by the platform - return e -} - -func main() { - // the appengine package provides a convenient method to handle the health-check requests - // and also run the app on the correct port. We just need to add Echo to the default handler - e := echo.New(":8080") - http.Handle("/", e) - appengine.Main() -} diff --git a/vendor/github.com/labstack/echo/cookbook/google-app-engine/app-standalone.go b/vendor/github.com/labstack/echo/cookbook/google-app-engine/app-standalone.go deleted file mode 100644 index c3b44dc0..00000000 --- a/vendor/github.com/labstack/echo/cookbook/google-app-engine/app-standalone.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build !appengine,!appenginevm - -package main - -import ( - "github.com/labstack/echo" - "github.com/labstack/echo/middleware" -) - -func createMux() *echo.Echo { - e := echo.New() - - e.Use(middleware.Recover()) - e.Use(middleware.Logger()) - e.Use(middleware.Gzip()) - - e.Static("/", "public") - - return e -} - -func main() { - e.Logger.Fatal(e.Start(":8080")) -} diff --git a/vendor/github.com/labstack/echo/cookbook/google-app-engine/app.go b/vendor/github.com/labstack/echo/cookbook/google-app-engine/app.go deleted file mode 100644 index 8d4d97a2..00000000 --- a/vendor/github.com/labstack/echo/cookbook/google-app-engine/app.go +++ /dev/null @@ -1,4 +0,0 @@ -package main - -// reference our echo instance and create it early -var e = createMux() diff --git a/vendor/github.com/labstack/echo/cookbook/google-app-engine/users.go b/vendor/github.com/labstack/echo/cookbook/google-app-engine/users.go deleted file mode 100644 index 19533e51..00000000 --- a/vendor/github.com/labstack/echo/cookbook/google-app-engine/users.go +++ /dev/null @@ -1,54 +0,0 @@ -package main - -import ( - "net/http" - - "github.com/labstack/echo" - "github.com/labstack/echo/middleware" -) - -type ( - user struct { - ID string `json:"id"` - Name string `json:"name"` - } -) - -var ( - users map[string]user -) - -func init() { - users = map[string]user{ - "1": user{ - ID: "1", - Name: "Wreck-It Ralph", - }, - } - - // hook into the echo instance to create an endpoint group - // and add specific middleware to it plus handlers - g := e.Group("/users") - g.Use(middleware.CORS()) - - g.POST("", createUser) - g.GET("", getUsers) - g.GET("/:id", getUser) -} - -func createUser(c echo.Context) error { - u := new(user) - if err := c.Bind(u); err != nil { - return err - } - users[u.ID] = *u - return c.JSON(http.StatusCreated, u) -} - -func getUsers(c echo.Context) error { - return c.JSON(http.StatusOK, users) -} - -func getUser(c echo.Context) error { - return c.JSON(http.StatusOK, users[c.Param("id")]) -} diff --git a/vendor/github.com/labstack/echo/cookbook/google-app-engine/welcome.go b/vendor/github.com/labstack/echo/cookbook/google-app-engine/welcome.go deleted file mode 100644 index 2639b209..00000000 --- a/vendor/github.com/labstack/echo/cookbook/google-app-engine/welcome.go +++ /dev/null @@ -1,31 +0,0 @@ -package main - -import ( - "html/template" - "io" - "net/http" - - "github.com/labstack/echo" -) - -type ( - Template struct { - templates *template.Template - } -) - -func init() { - t := &Template{ - templates: template.Must(template.ParseFiles("templates/welcome.html")), - } - e.Renderer = t - e.GET("/welcome", welcome) -} - -func (t *Template) Render(w io.Writer, name string, data interface{}, c echo.Context) error { - return t.templates.ExecuteTemplate(w, name, data) -} - -func welcome(c echo.Context) error { - return c.Render(http.StatusOK, "welcome", "Joe") -} -- cgit v1.2.3