Versions in this module Expand all Collapse all v0 v0.1.0 Feb 25, 2022 Changes in this version + func JsonParser(f io.Reader) (T, error) + type CachedDir struct + func (f *CachedDir) Cached() ([]fs.DirEntry, time.Time, bool) + func (f *CachedDir) Get(open func() (fs.File, error), maxAge time.Duration) ([]fs.DirEntry, error) + type CachedFile struct + func (f *CachedFile[T]) Cached() (T, time.Time, bool) + func (f *CachedFile[T]) Get(open func() (fs.File, error), parser Parser[T], maxAge time.Duration) (T, error) + type ConcurrentCachedDir struct + func (f *ConcurrentCachedDir) Cached() ([]fs.DirEntry, time.Time, bool) + func (f *ConcurrentCachedDir) Get(open func() (fs.File, error), maxAge time.Duration) ([]fs.DirEntry, error) + type ConcurrentCachedFile struct + func (f *ConcurrentCachedFile[T]) Cached() (T, time.Time, bool) + func (f *ConcurrentCachedFile[T]) Get(open func() (fs.File, error), parser Parser[T], maxAge time.Duration) (T, error) + type ConcurrentFsCache struct + func NewConcurrentFsCache(fs fs.FS, parser Parser[T], maxAge time.Duration) *ConcurrentFsCache[T] + func (cache *ConcurrentFsCache[T]) Clear() + func (cache *ConcurrentFsCache[T]) ClearDirs() + func (cache *ConcurrentFsCache[T]) ClearFiles() + func (cache *ConcurrentFsCache[T]) GetDir(dir string) ([]fs.DirEntry, error) + func (cache *ConcurrentFsCache[T]) GetDirEntry(path string) (entry *ConcurrentCachedDir, ok bool) + func (cache *ConcurrentFsCache[T]) GetDirWithMaxAge(dir string, maxAge time.Duration) ([]fs.DirEntry, error) + func (cache *ConcurrentFsCache[T]) GetFile(file string) (T, error) + func (cache *ConcurrentFsCache[T]) GetFileEntry(path string) (entry *ConcurrentCachedFile[T], ok bool) + func (cache *ConcurrentFsCache[T]) GetFileWithMaxAge(file string, maxAge time.Duration) (T, error) + func (cache *ConcurrentFsCache[T]) SetMaxAge(maxAge time.Duration) + type FsCache struct + MaxAge time.Duration + func NewFsCache(fs fs.FS, parser Parser[T], maxAge time.Duration) FsCache[T] + func (cache *FsCache[T]) Clear() + func (cache *FsCache[T]) ClearDirs() + func (cache *FsCache[T]) ClearFiles() + func (cache *FsCache[T]) GetDir(dir string) ([]fs.DirEntry, error) + func (cache *FsCache[T]) GetDirEntry(path string) (entry *CachedDir, ok bool) + func (cache *FsCache[T]) GetDirWithMaxAge(dir string, maxAge time.Duration) ([]fs.DirEntry, error) + func (cache *FsCache[T]) GetFile(file string) (T, error) + func (cache *FsCache[T]) GetFileEntry(path string) (entry *CachedFile[T], ok bool) + func (cache *FsCache[T]) GetFileWithMaxAge(file string, maxAge time.Duration) (T, error) + type Parser func(io.Reader) (T, error)