Documentation ¶
Index ¶
- Constants
- Variables
- func Cache(store *persistence.CacheStore) gin.HandlerFunc
- func CacheCustom(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc, ...) gin.HandlerFunc
- func CachePage(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
- func CachePageAtomic(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
- func CachePageAtomicDecorator(middleware Middleware, store persistence.CacheStore, expire time.Duration, ...) gin.HandlerFunc
- func CachePageWithoutHeader(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
- func CachePageWithoutQuery(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
- func CreateKey(u string) string
- func RegisterResponseCacheGob()
- func RequestURIKey(c *gin.Context) string
- func SiteCache(store persistence.CacheStore, expire time.Duration) gin.HandlerFunc
- func WithoutParamKey(c *gin.Context) string
- func WriteWithHeaders(c *gin.Context, cache responseCache)
- func WriteWithoutHeaders(c *gin.Context, cache responseCache)
- type KeyGenerator
- type Middleware
- type WriterHook
Constants ¶
View Source
const (
CACHE_MIDDLEWARE_KEY = "gincontrib.cache"
)
Variables ¶
View Source
var (
PageCachePrefix = "gincontrib.page.cache"
)
Functions ¶
func CacheCustom ¶
func CacheCustom( store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc, keyGenerator KeyGenerator, writerHook WriterHook, ) gin.HandlerFunc
func CachePage ¶
func CachePage(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
CachePage Decorator
func CachePageAtomic ¶
func CachePageAtomic(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
func CachePageAtomicDecorator ¶
func CachePageAtomicDecorator( middleware Middleware, store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc, ) gin.HandlerFunc
CachePageAtomic Decorator
func CachePageWithoutHeader ¶
func CachePageWithoutHeader(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
func CachePageWithoutQuery ¶
func CachePageWithoutQuery(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
CachePageWithoutQuery add ability to ignore GET query parameters.
func RegisterResponseCacheGob ¶
func RegisterResponseCacheGob()
RegisterResponseCacheGob registers the responseCache type with the encoding/gob package
func RequestURIKey ¶
func SiteCache ¶
func SiteCache(store persistence.CacheStore, expire time.Duration) gin.HandlerFunc
func WithoutParamKey ¶
func WriteWithHeaders ¶
func WriteWithoutHeaders ¶
Types ¶
type KeyGenerator ¶
type Middleware ¶
type Middleware func(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
type WriterHook ¶
Click to show internal directories.
Click to hide internal directories.