Documentation ¶
Index ¶
- Constants
- Variables
- func Cache(store persistence.CacheStore) 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 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 SetPageKey(key string)
- func SiteCache(store persistence.CacheStore, expire time.Duration) gin.HandlerFunc
Constants ¶
View Source
const ( // ResultLimitHeader is request limit ResultLimitHeader = "X-Result-Limit" // ResultOffsetHeader is request offset ResultOffsetHeader = "X-Result-Offset" // ResultSortHeader is request sort ResultSortHeader = "X-Result-Sort" // ResultCountHeader is request result count ResultCountHeader = "X-Result-Count" AuthenticationHeader = "X-Druid-Authentication" // ResultLastParam url last ResultLastHeader = "X-Result-Last" )
Variables ¶
View Source
var (
CACHE_MIDDLEWARE_KEY = "gincontrib.cache"
)
View Source
var (
PageCachePrefix = "gincontrib.page.cache"
)
Functions ¶
func CachePage ¶
func CachePage(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
CachePage Decorator
func CachePageAtomic ¶ added in v1.1.4
func CachePageAtomic(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
CachePageAtomic Decorator
func CachePageWithoutHeader ¶ added in v1.1.4
func CachePageWithoutHeader(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
func CachePageWithoutQuery ¶ added in v1.1.4
func CachePageWithoutQuery(store persistence.CacheStore, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc
CachePageWithoutQuery add ability to ignore GET query parameters.
func RegisterResponseCacheGob ¶ added in v1.1.4
func RegisterResponseCacheGob()
RegisterResponseCacheGob registers the responseCache type with the encoding/gob package
func SetPageKey ¶
func SetPageKey(key string)
func SiteCache ¶
func SiteCache(store persistence.CacheStore, expire time.Duration) gin.HandlerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.