filecache

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package filecache provides a file cache

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoCachedKey is returned when there is no cached key available.
	ErrNoCachedKey = errors.New("no cached key")
)

Functions

This section is empty.

Types

type FileCache

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

FileCache provides a simple file-based cache implementation.

func New

func New(
	cacheDir string,
	prefix string,
	filesystem afero.Fs,
) *FileCache

New creates a new FileCache instance.

func (*FileCache) Delete

func (fc *FileCache) Delete(key string) error

Delete removes the cache entry for a given key.

func (*FileCache) Get

func (fc *FileCache) Get(key string) ([]byte, error)

Get retrieves data from the cache for a given key.

func (*FileCache) GetFilename

func (fc *FileCache) GetFilename(id string) string

GetFilename constructs the full path for a given cache key.

func (*FileCache) Set

func (fc *FileCache) Set(key string, data []byte) error

Set stores data in the cache for a given key.

Jump to

Keyboard shortcuts

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