Documentation ¶
Index ¶
- Variables
- type Cache
- func ConstCache(data []byte) Cache
- func FileCache(dirname string) Cache
- func FileCacheWithFormat(dirname string, format string) Cache
- func FileCacheWithNameFn(dirname string, filename func(string) string) Cache
- func MemoryCache() Cache
- func WriteTroughCache(dirname string) Cache
- func WriteTroughCacheWithFormat(dirname, format string) Cache
- func WriteTroughCacheWithNameFn(dirname string, fn func(string) string) Cache
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyCache = &emptyCache{}
EmptyCache represents a cache that never stores anything
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Get gets the data, returning nil if it isn't cached Get(key string) ([]byte, error) // Set saves data, Set(key string, data []byte) error }
Cache represents a cache
func ConstCache ¶
ConstCache creates a Cache that always returns the same data
func FileCacheWithFormat ¶
FileCacheWithFormat creates a FileCache that uses a format string to generate filenames
func FileCacheWithNameFn ¶
FileCacheWithNameFn creates a FileCache that has a custom function to generate filenames
func WriteTroughCache ¶
WriteTroughCache creates a cache that stores keys in memory and uses disk as fallback
func WriteTroughCacheWithFormat ¶
WriteTroughCacheWithFormat creates a cache that stores keys in memory and uses disk as fallback and that generates filenames based on the format
Click to show internal directories.
Click to hide internal directories.