Documentation
¶
Index ¶
- type Cache
- func (c *Cache[T]) Entry(fileName string) Entry[T]
- func (c *Cache[T]) Invalidate(fileName string)
- func (*Cache[T]) IsStale(fileName string, entry Entry[T]) (bool, os.FileInfo, error)
- func (c *Cache[T]) Load(fileName string) (T, bool)
- func (c *Cache[T]) LoadLatest(fileName string, loader func() (T, error)) (T, error)
- func (c *Cache[T]) StartEviction()
- func (c *Cache[T]) Stop()
- func (c *Cache[T]) StopEviction()
- func (c *Cache[T]) Store(fileName string, data T, fi os.FileInfo)
- type Entry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[T any] struct { // contains filtered or unexported fields }
TODO: Consider replacing this with golang-lru: https://github.com/hashicorp/golang-lru
func (*Cache[T]) Invalidate ¶
func (*Cache[T]) LoadLatest ¶
func (*Cache[T]) StartEviction ¶
func (c *Cache[T]) StartEviction()
func (*Cache[T]) StopEviction ¶
func (c *Cache[T]) StopEviction()
Click to show internal directories.
Click to hide internal directories.