cache

package
v0.0.0-...-f53fec1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CACHE_MIDDLEWARE_KEY = "gincontrib.cache"
)

Variables

View Source
var (
	PageCachePrefix = "gincontrib.page.cache"
)

Functions

func Cache

func Cache(store *persistence.CacheStore) gin.HandlerFunc

Cache Middleware

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

function to be used to cache pages in thread-safe manner

func RegisterResponseCacheGob

func RegisterResponseCacheGob()

RegisterResponseCacheGob registers the responseCache type with the encoding/gob package

func SiteCache

func SiteCache(store persistence.CacheStore, expire time.Duration) gin.HandlerFunc

Types

type ResponseCache

type ResponseCache struct {
	Status int
	Header http.Header
	Data   []byte
}

Jump to

Keyboard shortcuts

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