Documentation ¶
Index ¶
- type Cache
- func (c *Cache) Has(filename string) bool
- func (c *Cache) Invalidate(filename string) error
- func (c *Cache) Path(filename string) string
- func (c *Cache) Read(w io.Writer, filename string) error
- func (c *Cache) Store(r io.Reader, filename string) error
- func (c *Cache) Writer(filename string) (*os.File, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache implements a Cacher using the local filesystem.
func New ¶
New returns a new Cache object.
The internal cache directory path is computed based on the provided workdir. The workdir will contain a hashed subfolder if a unique identifier is also provided.
func (*Cache) Invalidate ¶
Invalidate invalidates a cache file named by filename
func (*Cache) Read ¶
Read reads a cached file named by filename and writes the contents to the provider w writer.
If the file does not exist, Read returns an error that satisfies errors.IsNotFound().
Click to show internal directories.
Click to hide internal directories.