Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FileCachePath = "cache" // cache directory FileCacheExpire time.Duration // cache expire time, default is no expire forever. )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
a cache for file storage.
func MustNewFileSysStore ¶
func MustNewFileSysStore(baseDir string, interval time.Duration, serializer cache.Serializer) *Cache
MustNewFileSysStore an initialized Filesystem Cache If a non-existent directory is passed, it would be created automatically. Panics if the directory could not be created
func (*Cache) Get ¶
Get value from file cache. if non-exist or expired, return nil, error. run garbage collection with the key if necessary
Click to show internal directories.
Click to hide internal directories.