Documentation ¶
Index ¶
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 provides a facility to temporarily store images on disk for later retrival.
func NewCache ¶
NewCache creates a new cache, backed by subdirectory 'subdir' inside the cache directory. The cache is pre-populated with any images found in this directory.
func (*Cache) Close ¶
Close must be called when the cache is no longer needed. Up to 'pruneLimit' bytes of images may be left behind in the cache directory; these files will be used to pre-populate future Cache instances.
If pruneLimit >= 0, images added using the current Cache instance will always be retained, even if their total size exceeds pruneLimit. If pruneLimit < 0, all cached data is removed.
func (*Cache) Get ¶
Get returns an image which has previously been stored in the cache for the given key.