Documentation
¶
Overview ¶
Package cache implements an optional SSD-backed cache for compressed chunks.
Index ¶
- type Cache
- func (c *Cache) Get(ctx context.Context, key string) ([]byte, bool, error)
- func (c *Cache) Open(ctx context.Context, key string) (*os.File, bool, error)
- func (c *Cache) Put(ctx context.Context, key string, data []byte) error
- func (c *Cache) PutReader(ctx context.Context, key string, source io.Reader, size int64) error
- func (c *Cache) Remove(key string) error
- func (c *Cache) Resize(capacity int64) error
- func (c *Cache) Usage(ctx context.Context) (Usage, error)
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) Open ¶
Open returns an owned read-only fd to an immutable cached representation. Eviction may unlink its name after return without affecting this reader. A concurrent replacement likewise leaves the opened inode unchanged.
func (*Cache) PutReader ¶
PutReader stores a complete immutable representation without requiring an additional whole-object byte buffer. The reader is consumed before return.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package reader provides a bounded, coalescing cache of immutable decoded chunks.
|
Package reader provides a bounded, coalescing cache of immutable decoded chunks. |
|
Package writer provides a durable raw-chunk cache.
|
Package writer provides a durable raw-chunk cache. |