Documentation
¶
Index ¶
- func Cache(defaultCacheStore persist.CacheStore, defaultExpire time.Duration, ...) gin.HandlerFunc
- func CacheByRequestPath(defaultCacheStore persist.CacheStore, defaultExpire time.Duration, ...) gin.HandlerFunc
- func CacheByRequestURI(defaultCacheStore persist.CacheStore, defaultExpire time.Duration, ...) gin.HandlerFunc
- type Config
- type Discard
- type GetCacheStrategyByRequest
- type Logger
- type Option
- type Strategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cache ¶
func Cache( defaultCacheStore persist.CacheStore, defaultExpire time.Duration, opts ...Option, ) gin.HandlerFunc
Cache user must pass getCacheKey to describe the way to generate cache key
func CacheByRequestPath ¶ added in v1.0.0
func CacheByRequestPath(defaultCacheStore persist.CacheStore, defaultExpire time.Duration, opts ...Option) gin.HandlerFunc
CacheByRequestPath a shortcut function for caching response with url path, discard the query params
func CacheByRequestURI ¶ added in v1.0.0
func CacheByRequestURI(defaultCacheStore persist.CacheStore, defaultExpire time.Duration, opts ...Option) gin.HandlerFunc
CacheByRequestURI a shortcut function for caching response with uri
Types ¶
type GetCacheStrategyByRequest ¶ added in v1.0.0
type Option ¶ added in v1.0.0
type Option func(c *Config)
func WithCacheStrategyByRequest ¶ added in v1.0.0
func WithCacheStrategyByRequest(getGetCacheStrategyByRequest GetCacheStrategyByRequest) Option
func WithLogger ¶ added in v1.0.0
Click to show internal directories.
Click to hide internal directories.

