cache

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PageCachePrefix = "gincontrib.page.cache"
	ErrCacheMiss    = errors.New("cache: key not found.")
	ErrNotStored    = errors.New("cache: not stored.")
	ErrNotSupport   = errors.New("cache: not support.")
)

Functions

func CachePage

func CachePage(store cache.IShortCache, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc

func NewPageCache

func NewPageCache(store cache.IShortCache, expire time.Duration, handle gin.HandlerFunc) gin.HandlerFunc

func SiteCache

func SiteCache(store cache.IShortCache, expire time.Duration) gin.HandlerFunc

Types

type Option

type Option func(*option)

func WithCache

func WithCache(cache cache.IShortCache) Option

WithCache cache

func WithLogger

func WithLogger(logger glog.ILogger) Option

Jump to

Keyboard shortcuts

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