Documentation ¶
Index ¶
- func CleanOutOfSyncWithDelay(mctx libkb.MetaContext, d *DiskLRU, cacheDir string, delay time.Duration)
- type Cache
- func (c *Cache) ClearMemory()
- func (c *Cache) Get(ctx context.Context, lctx libkb.LRUContext, k libkb.LRUKeyer) (interface{}, error)
- func (c *Cache) OnDbNuke(mctx libkb.MetaContext) error
- func (c *Cache) OnLogout(mctx libkb.MetaContext) error
- func (c *Cache) Put(ctx context.Context, lctx libkb.LRUContext, k libkb.LRUKeyer, v interface{}) error
- type DiskLRU
- func (d *DiskLRU) CleanOutOfSync(mctx libkb.MetaContext, cacheDir string) error
- func (d *DiskLRU) ClearMemory(ctx context.Context, lctx libkb.LRUContext)
- func (d *DiskLRU) Flush(ctx context.Context, lctx libkb.LRUContext) error
- func (d *DiskLRU) Get(ctx context.Context, lctx libkb.LRUContext, key string) (found bool, res DiskLRUEntry, err error)
- func (d *DiskLRU) MaxSize() int
- func (d *DiskLRU) Put(ctx context.Context, lctx libkb.LRUContext, key string, value interface{}) (evicted *DiskLRUEntry, err error)
- func (d *DiskLRU) Remove(ctx context.Context, lctx libkb.LRUContext, key string) (err error)
- func (d *DiskLRU) Size(ctx context.Context, lctx libkb.LRUContext) (int, error)
- type DiskLRUEntry
- type Pathable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanOutOfSyncWithDelay ¶
func CleanOutOfSyncWithDelay(mctx libkb.MetaContext, d *DiskLRU, cacheDir string, delay time.Duration)
CleanOutOfSyncWithDelay runs the LRU clean function after the `delay` duration. If the service crashes it's possible that temporarily files get stranded on disk before they can get recorded in the LRU. Callers can run this in the background to prevent leaking space. We delay to keep off the critical path to start up.
Types ¶
type DiskLRU ¶ added in v1.0.46
DiskLRU maintains a cache of files on the disk in a LRU manner.
func NewDiskLRU ¶ added in v1.0.46
func (*DiskLRU) CleanOutOfSync ¶
func (d *DiskLRU) CleanOutOfSync(mctx libkb.MetaContext, cacheDir string) error
func (*DiskLRU) ClearMemory ¶ added in v1.0.46
func (d *DiskLRU) ClearMemory(ctx context.Context, lctx libkb.LRUContext)
func (*DiskLRU) Get ¶ added in v1.0.46
func (d *DiskLRU) Get(ctx context.Context, lctx libkb.LRUContext, key string) (found bool, res DiskLRUEntry, err error)
func (*DiskLRU) Put ¶ added in v1.0.46
func (d *DiskLRU) Put(ctx context.Context, lctx libkb.LRUContext, key string, value interface{}) (evicted *DiskLRUEntry, err error)
type DiskLRUEntry ¶ added in v1.0.46
Click to show internal directories.
Click to hide internal directories.