Documentation
¶
Index ¶
- type DiskCache
- func (c *DiskCache) Contains(ctx context.Context, key string) (bool, error)
- func (c *DiskCache) Delete(ctx context.Context, key string) error
- func (c *DiskCache) Get(ctx context.Context, key string) ([]byte, error)
- func (c *DiskCache) PrefixKey(ctx context.Context, blobName string) (string, error)
- func (c *DiskCache) Reader(ctx context.Context, key string, offset, length int64) (io.Reader, error)
- func (c *DiskCache) Set(ctx context.Context, key string, data []byte) error
- func (c *DiskCache) Start() error
- func (c *DiskCache) Stop() error
- func (c *DiskCache) Writer(ctx context.Context, key string) (io.WriteCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiskCache ¶
type DiskCache struct {
// contains filtered or unexported fields
}
Blobstore is *almost* sufficient here, but blobstore doesn't handle record expirations in a way that make sense for a cache. So we keep a record (in memory) of file atime (Last Access Time) and size, and then when our cache reaches fullness we remove the most stale files. Rather than serialize this ledger, we regenerate it from scratch on startup by looking at the filesystem itself.
Click to show internal directories.
Click to hide internal directories.