Documentation
¶
Overview ¶
Package fscache is a simple, non-magical helper package for loading file-system content only once and using an in-memory cache for consecutive requests
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FsCache ¶
type FsCache struct {
// contains filtered or unexported fields
}
FsCache holds the caching structure and needed internals to cache file- system content.
func NewFsCache ¶
NewFsCache returns a new instance of FsCache
func (*FsCache) Load ¶
Load looks if the file is already in the internal memory-buffer cache. If so it returns it immediately, else the file is loaded, stored to the cache and returned. If the FsCache is in production mode the file is loaded from disk each time it's requested. This feature can be used if the underlying file-content changes during development.
func (*FsCache) Preload ¶
Preload loads the file in path, it it exists, into the internal caching structure
func (*FsCache) PreloadBatch ¶
PreloadBatch is like Preload but performs the operation for a full batch, while still only acquiring internal mutexes once.