Documentation
¶
Overview ¶
Package imagecache is the privacy proxy's store for remote mail images: a directory of files named by their URL's hash, shared by all messages, bounded in size and evicted least recently used first. Get downloads an image once (through imagefetch: public hosts, no cookies, no Referer) and serves it from disk after that, offline too.
Index ¶
Constants ¶
View Source
const ( MaxBytes = 256 << 20 // the cache's size GlobalJobs = 8 // downloads at once HostJobs = 3 // downloads at once from one host )
Limits of the fetching proxy.
Variables ¶
View Source
var ErrClosed = errors.New("image cache is closed")
ErrClosed is returned by Get after Close.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a directory of images; it is safe for concurrent use.
func Open ¶
Open is the cache in dir (made if need be), at most max bytes (MaxBytes when 0), downloading with client.
func (*Cache) Close ¶
func (c *Cache) Close()
Close cancels the downloads in flight and waits for them; Get fails after.
Click to show internal directories.
Click to hide internal directories.