Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotStored = errors.New("item not stored") ErrCacheMiss = errors.New("cache miss") ErrInvalidKey = errors.New("invalid key") )
Error messages.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a wrapper around os.File providing simple file caching.
func (*Cache) Add ¶
Add writes the given item, if no value already exists for its key. ErrNotStored is returned if that condition is not met.
func (*Cache) Delete ¶
Delete deletes the item with the provided key. ErrCacheMiss is returned if the item didn't already exist in the cache.
Click to show internal directories.
Click to hide internal directories.