Versions in this module Expand all Collapse all v2 v2.8.1 Nov 22, 2023 v2.8.0 Nov 22, 2023 Changes in this version + const DefaultTTL + const MsgInvalidTTL + const MsgMissingLoaderFunc + var ErrInvalidTTL = errors.New(MsgInvalidTTL) + var ErrMissingLoaderFunc = errors.New(MsgMissingLoaderFunc) + type Loader struct + func New(lf LoaderFunc, ttl time.Duration) (*Loader, error) + func (ld *Loader) Contains(ctx context.Context, key string) bool + func (ld *Loader) Hits() int64 + func (ld *Loader) Load(ctx context.Context, key string) (interface{}, error) + func (ld *Loader) Misses() int64 + func (ld *Loader) Ratio() float64 + func (ld *Loader) Remove(ctx context.Context, key string) + func (ld *Loader) Stats() string + func (ld *Loader) Update(ctx context.Context, key string, value interface{}) error + type LoaderFunc func(context.Context, string) (interface{}, error)