Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrBadDir = errors.New("invalid directory") ErrBadSize = errors.New("storage size must be greater then zero") ErrBadCap = errors.New("file number must be greater then zero") ErrTooLarge = errors.New("file size must be less or equal storage size") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func New ¶
New creates a Cache backed by dir on disk. The cache allows at most c files of total size sz.
func (*Cache) Get ¶
func (c *Cache) Get(key string) (io.ReadCloser, error)
Get returns a reader for a blob in the cache, or ErrNotFound otherwise.
Click to show internal directories.
Click to hide internal directories.