Versions in this module Expand all Collapse all v0 v0.1.2 Apr 27, 2021 v0.1.1 Apr 26, 2021 v0.1.0 Apr 25, 2021 Changes in this version + var DefaultConfig = Config + var ErrAlreadyExists = errors.BaseError("filecache: file at path already exists") + var ErrClosed = errors.BaseError("filecache: closed") + var ErrFailedRefresh = errors.BaseError("filecache: failed refreshing cache entry") + var ErrFileTooLarge = errors.BaseError("filecache: file too large") + var ErrNotFound = errors.BaseError("filecache: file not found") + type CacheEntry struct + func (e *CacheEntry) Bytes() []byte + func (e *CacheEntry) Reader() io.Reader + func (e *CacheEntry) Release() + type Config struct + AllowOverwrites bool + ErrorEvictionCallback func(path string, file File, err error) + EvictionCallback func(path string, file File) + MaxAge time.Duration + MaxSize int64 + RefreshFreq time.Duration + Size int + type File interface + Open func() (io.ReadCloser, error) + Stat func() (os.FileInfo, error) + type FileCache struct + func New(cfg *Config) *FileCache + func (fc *FileCache) Get(path string) (*CacheEntry, error) + func (fc *FileCache) Put(path string, file File) error + func (fc *FileCache) Remove(path string)