import "gitoa.ru/go-4devs/cache/mw"
HandleByErr checks if cache return err.
LabelName sets static name.
LabelPreficKey gets lebale by item prefix.
WithClearByContext clear cache if context done.
WithClearByTTL clear cache by key after ttl.
func WithFallback(fallback Fallback, isHandleFallback func(*cache.Item, error) bool) cache.Configure
WithFallback sets fallback when cache handle success and set result in cache.
WithLockGetter sets values from getter when cache handle success and set result in cache.
func WithMetrics(m Metrics, labelCallback func(ctx context.Context, item *cache.Item) string) cache.Configure
WithMetrics cache middleware metrics.
LockFallback locks run fallback by item key.
type Metrics interface { Hit(label string) Miss(label string) Expired(label string) Err(label string, operation string) Observe(label string, operation string, start time.Time) }
Metrics interface for middleware.
Path | Synopsis |
---|---|
prometheus |
Package mw imports 6 packages (graph) and is imported by 1 packages. Updated 2021-01-28. Refresh now. Tools for package owners.