Documentation ¶
Index ¶
- type BaseCache
- func (c *BaseCache) Check()
- func (c *BaseCache) Collect() map[string]CacheObject
- func (c *BaseCache) Delete(key string) error
- func (c *BaseCache) Get(key string) (object CacheObject, err error)
- func (c *BaseCache) GetHitRate() int
- func (c *BaseCache) GetUsage() int
- func (c *BaseCache) GetUsageRate() int
- func (c *BaseCache) Lock()
- func (c *BaseCache) Reset()
- func (c *BaseCache) Set(key string, object CacheObject) error
- func (c *BaseCache) SetCleanFunc(f CacheCleanFunc)
- func (c *BaseCache) Unlock()
- type BaseCdb
- type BasicCdbm
- func (cdbm *BasicCdbm) Check()
- func (cdbm *BasicCdbm) Collect() map[string]CacheObject
- func (cdbm *BasicCdbm) Find(key string) (CacheDirectoryBlock, error)
- func (cdbm *BasicCdbm) GetUsage() int
- func (cdbm *BasicCdbm) MakeSpace(objectSize, sizeLimit int, f CacheCleanFunc) (CacheDirectoryBlock, error)
- func (cdbm *BasicCdbm) Remove(key string, f CacheCleanFunc) error
- func (cdbm *BasicCdbm) Replace(key string, object CacheObject, sizeLimit int, f CacheCleanFunc) error
- func (cdbm *BasicCdbm) Reset(f CacheCleanFunc)
- type CacheDirectoryBlock
- type CdbManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseCache ¶
type BaseCache struct { //this is called on the object evicted from the cache CleanFunc CacheCleanFunc //CacheDirectoryBlock Manager CdbManager // contains filtered or unexported fields }
func NewBaseCache ¶
func NewBaseCache(size int, cdbm CdbManager) *BaseCache
func NewRRCache ¶
func NewSafeBaseCache ¶
func NewSafeBaseCache(size int, cdbm CdbManager) *BaseCache
func NewSafeRRCache ¶
func (*BaseCache) GetHitRate ¶
func (*BaseCache) GetUsageRate ¶
func (*BaseCache) SetCleanFunc ¶
func (c *BaseCache) SetCleanFunc(f CacheCleanFunc)
type BaseCdb ¶
type BaseCdb struct {
// contains filtered or unexported fields
}
func NewBasicCdb ¶
func NewBasicCdb() *BaseCdb
type BasicCdbm ¶
type BasicCdbm struct { //hash table for searching cache entries Hash map[string]CacheDirectoryBlock Size int }
func NewBasicCdbm ¶
func NewBasicCdbm() *BasicCdbm
func (*BasicCdbm) MakeSpace ¶
func (cdbm *BasicCdbm) MakeSpace(objectSize, sizeLimit int, f CacheCleanFunc) (CacheDirectoryBlock, error)
type CacheDirectoryBlock ¶
Click to show internal directories.
Click to hide internal directories.