Documentation ¶
Overview ¶
Package diskcache implements disk backed cache storage for use in greenhouse
Index ¶
- type Cache
- func (c *Cache) Delete(key string) error
- func (c *Cache) DiskRoot() string
- func (c *Cache) Get(key string, readHandler ReadHandler) error
- func (c *Cache) GetEntries() []EntryInfo
- func (c *Cache) KeyToPath(key string) string
- func (c *Cache) PathToKey(key string) string
- func (c *Cache) Put(key string, content io.Reader, contentSHA256 string) error
- type EntryInfo
- type ReadHandler
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 disk backed cache storage
func NewCache ¶
NewCache returns a new Cache given the root directory that should be used on disk for cache storage
func (*Cache) Get ¶
func (c *Cache) Get(key string, readHandler ReadHandler) error
Get provides your readHandler with the contents at key
func (*Cache) GetEntries ¶
GetEntries walks the cache dir and returns all paths that exist In the future this *may* be made smarter
type ReadHandler ¶
type ReadHandler func(exists bool, contents io.ReadSeeker) error
ReadHandler should be implemented by cache users for use with Cache.Get
Click to show internal directories.
Click to hide internal directories.