Documentation
¶
Index ¶
Constants ¶
View Source
const ( ConfigKeyBasepath = "basepath" ConfigKeyMaxZoom = "max_zoom" )
View Source
const CacheType = "file"
Variables ¶
View Source
var ( ErrMissingBasepath = errors.New("filecache: missing required param 'basepath'") ErrCacheMiss = errors.New("filecache: cache miss") )
Functions ¶
Types ¶
type Filecache ¶
type Filecache struct {
Basepath string
// we need a cache mutex to avoid concurrent writes to our Locker
sync.RWMutex
// Locker tracks which cache keys are being operated on.
// when the cache is being written to a Lock() is set.
// when being read from an RLock() is used so we don't
// block concurrent reads.
//
// TODO: store a hash of the cache blob along with the Locker mutex
Locker map[string]sync.RWMutex
// MaxZoom determins the max zoom the cache to persist. Beyond this
// zoom, cache Set() calls will be ignored. This is useful if the cache
// should not be leveraged for higher zooms when data changes often.
MaxZoom *uint
}
Click to show internal directories.
Click to hide internal directories.