add vendor

This commit is contained in:
deepzz0 committed 2017-02-18 15:23:57 +08:00
1 parent 4ebbc38cc0
commit 562f4d86c6
1371 files changed
+369552 -2

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
package main
import (
"fmt"
"github.com/gin-gonic/contrib/cache"
"github.com/gin-gonic/gin"
"time"
)
func main() {
r := gin.Default()
store := cache.NewInMemoryStore(time.Second)
// Cached Page
r.GET("/ping", func(c *gin.Context) {
c.String(200, "pong "+fmt.Sprint(time.Now().Unix()))
})
r.GET("/cache_ping", cache.CachePage(store, time.Minute, func(c *gin.Context) {
c.String(200, "pong "+fmt.Sprint(time.Now().Unix()))
}))
// Listen and Server in 0.0.0.0:8080
r.Run(":8080")
}