Categorygithub.com/Pantani/gincache
modulepackage
1.0.1
Repository: https://github.com/pantani/gincache.git
Documentation: pkg.go.dev

# README

Simple cache for gin

Simple memory cache for gin API.

E.g.:

  • Create an API cache adding the middleware to your route:
router.POST("/cache/list", gincache.CacheMiddleware(time.Hour*24, func(c *gin.Context) {
    // handler implementation		
}))

# Functions

CacheMiddleware encapsulates a gin handler function and caches the response with an expiration time.