Documentation ¶
Overview ¶
Package cacher provides various blobref fetching caching mechanisms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachingFetcher ¶
type CachingFetcher struct {
// contains filtered or unexported fields
}
A CachingFetcher is a blob.Fetcher and a blob.SeekFetcher.
func NewCachingFetcher ¶
func NewCachingFetcher(cache blobserver.Cache, fetcher blob.Fetcher) *CachingFetcher
NewCachingFetcher returns a CachingFetcher that fetches from fetcher and writes to and serves from cache.
func (*CachingFetcher) Fetch ¶
func (cf *CachingFetcher) Fetch(br blob.Ref) (file io.ReadCloser, size uint32, err error)
type DiskCache ¶
type DiskCache struct { *CachingFetcher // Root is the temp directory being used to store files. // It is available mostly for debug printing. Root string // contains filtered or unexported fields }
A DiskCache is a blob.Fetcher that serves from a local temp directory and is backed by a another blob.Fetcher (usually the pkg/client HTTP client).
func NewDiskCache ¶
NewDiskCache returns a new DiskCache from a Fetcher, which is usually the pkg/client HTTP client (which typically has much higher latency and lower bandwidth than local disk).
Click to show internal directories.
Click to hide internal directories.