filecache

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInitialize          = errors.New("unable to initialize cache")
	ErrCannotOpen          = errors.New("unable to open cached file")
	ErrGCleanupNotRequired = errors.New("no need to remove old entries")
	ErrAlreadyClosed       = errors.New("the file was already closed")
)

Functions

This section is empty.

Types

type FileCache

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

func NewFileCache

func NewFileCache(
	root string,
	quotaLow, quotaHigh int64,
	logger *zerolog.Logger,
) (*FileCache, error)

func (*FileCache) Delete added in v0.0.11

func (f *FileCache) Delete(hash string, logger *zerolog.Logger) error

func (*FileCache) GetAllHashes

func (f *FileCache) GetAllHashes() ([]string, error)

func (*FileCache) GetStatistics

func (f *FileCache) GetStatistics() (count int64, totalSize units.Bytes, err error)

func (*FileCache) Open

func (f *FileCache) Open(hash string, logger *zerolog.Logger) (io.ReadCloser, error)

func (*FileCache) Prune

func (f *FileCache) Prune(logger *zerolog.Logger) (int64, error)

func (*FileCache) SetupIngestion

func (f *FileCache) SetupIngestion(
	src io.ReadCloser,
	onIngest func(hash string),
	onCleanup func(),
	logger *zerolog.Logger,
) io.ReadCloser

func (*FileCache) Stat

func (f *FileCache) Stat(hash string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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