gincache

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 13 Imported by: 0

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		
}))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheMiddleware

func CacheMiddleware(expiration time.Duration, handle gin.HandlerFunc) gin.HandlerFunc

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

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL