Versions in this module Expand all Collapse all v0 v0.0.1 Apr 30, 2024 Changes in this version + func NewCache(defaultCacheStore persist.CacheStore, defaultExpire time.Duration, ...) app.HandlerFunc + func NewCacheByRequestPath(defaultCacheStore persist.CacheStore, defaultExpire time.Duration, ...) app.HandlerFunc + func NewCacheByRequestURI(defaultCacheStore persist.CacheStore, defaultExpire time.Duration, ...) app.HandlerFunc + func NewCacheByRequestURIWithIgnoreQueryOrder(defaultCacheStore persist.CacheStore, defaultExpire time.Duration, ...) app.HandlerFunc + type BeforeReplyWithCacheCallback func(c *app.RequestContext, cache *ResponseCache) + type GetCacheStrategyByRequest func(ctx context.Context, c *app.RequestContext) (bool, Strategy) + type OnHitCacheCallback app.HandlerFunc + type OnMissCacheCallback app.HandlerFunc + type OnShareSingleFlightCallback func(ctx context.Context, c *app.RequestContext) + type Option struct + F func(o *Options) + func WithBeforeReplyWithCache(cb BeforeReplyWithCacheCallback) Option + func WithCacheStrategyByRequest(getGetCacheStrategyByRequest GetCacheStrategyByRequest) Option + func WithOnHitCache(cb OnHitCacheCallback) Option + func WithOnMissCache(cb OnMissCacheCallback) Option + func WithOnShareSingleFlight(cb OnShareSingleFlightCallback) Option + func WithPrefixKey(prefix string) Option + func WithSingleFlightForgetTimeout(forgetTimeout time.Duration) Option + func WithoutHeader(b bool) Option + type Options struct + func (o *Options) Apply(opts []Option) + type ResponseCache struct + Data []byte + Header http.Header + Status int + type Strategy struct + CacheDuration time.Duration + CacheKey string + CacheStore persist.CacheStore