filecache

package
v0.4.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package filecache provides a local filesystem-backed implementation of cache.ReadWriterOf[blob.Entry] with persistent snapshots and immutable blob files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage is a local filesystem-backed blob storage.

func NewStorage

func NewStorage(path string) (*Storage, error)

NewStorage creates a local filesystem-backed blob storage.

func (*Storage) Close

func (s *Storage) Close() error

Close dumps the in-memory index and stops background jobs.

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, key []byte) error

Delete deletes a blob entry by key.

func (*Storage) Read

func (s *Storage) Read(ctx context.Context, key []byte) (blob.Entry, error)

Read reads a blob entry by key.

func (*Storage) Write

func (s *Storage) Write(ctx context.Context, key []byte, entry blob.Entry) error

Write materializes a blob entry into local storage and updates the index.

func (*Storage) WriteAndRead

func (s *Storage) WriteAndRead(ctx context.Context, key []byte, entry blob.Entry) (blob.Entry, error)

WriteAndRead materializes a blob entry into local storage, updates the index, and returns the stored entry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL