Documentation
¶
Index ¶
- Constants
- type CacheType
- func (mc *CacheType) Add(key string, value interface{}) (itemID int64)
- func (mc *CacheType) Cache() (cache map[string]*ValueType)
- func (mc *CacheType) Delete(key string)
- func (mc *CacheType) Evictor()
- func (mc *CacheType) Get(key string) (value interface{}, ok bool)
- func (mc *CacheType) GetByID(itemID int64) (item interface{})
- func (mc *CacheType) GetEx(key string) (*ValueType, bool)
- func (mc *CacheType) Len() (cacheSize int64)
- func (mc *CacheType) LenSafe() (cacheSize int64)
- func (mc *CacheType) LockWithKey(key string)
- func (mc *CacheType) Set(key string, value interface{})
- func (mc *CacheType) SetEx(key string, value interface{}, expires int64)
- func (mc *CacheType) SetLockWithKeyTimeout(timeout time.Duration)
- func (mc *CacheType) Stop()
- func (mc *CacheType) UnlockWithKey(key string)
- func (mc *CacheType) UnsafeDelete(key string)
- type Logger
- type ValueType
Constants ¶
View Source
const (
LockWithKeyDefaultTimeout = 10 * time.Millisecond
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheType ¶
type CacheType struct {
// contains filtered or unexported fields
}
CacheType - cache structure with bound methods
func (*CacheType) Evictor ¶
func (mc *CacheType) Evictor()
Evictor - background goroutine that periodically purges expired keys
func (*CacheType) LockWithKey ¶ added in v1.0.2
func (*CacheType) SetLockWithKeyTimeout ¶ added in v1.0.2
func (*CacheType) Stop ¶
func (mc *CacheType) Stop()
Stop - run some cleaning chores during shutdown
func (*CacheType) UnlockWithKey ¶ added in v1.0.2
func (*CacheType) UnsafeDelete ¶
UnsafeDelete - removes item from cache
Click to show internal directories.
Click to hide internal directories.