Documentation ¶
Index ¶
- Constants
- type Cache
- func (c *Cache) Get(ctx context.Context, k []byte) []byte
- func (c *Cache) Has(k []byte) bool
- func (c *Cache) Remove(ctx context.Context, k []byte) error
- func (c *Cache) Reset()
- func (c *Cache) Set(ctx context.Context, k []byte, v []byte)
- func (c *Cache) Stop()
- func (c *Cache) UpdateStats(fcs *fastcache.Stats)
- type KeyScope
- type Manager
- type Mode
- type Scope
- type Tracer
Constants ¶
View Source
const (
Key = attribute.Key("cache.key")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a cache for working set entries.
The cache evicts inactive entries after the given expireDuration. Recently accessed entries survive expireDuration.
func New ¶
New creates new cache with the given maxBytes capacity in bytes and *cacheExpireDuration expiration.
Stop must be called on the returned cache when it is no longer needed.
func (*Cache) Stop ¶
func (c *Cache) Stop()
Stop stops the cache.
The cache cannot be used after the Stop call.
func (*Cache) UpdateStats ¶
UpdateStats updates fcs with cache stats.
Click to show internal directories.
Click to hide internal directories.