Documentation ¶
Index ¶
- type Cache
- type SyncMap
- func (sm *SyncMap) DeleteEntry(key string)
- func (sm *SyncMap) GetEntry(key string) (entry interface{}, ok bool)
- func (sm *SyncMap) GetLength() int
- func (sm *SyncMap) SetEntry(key string, entry interface{})
- func (sm *SyncMap) SetEvictionPercentage(newPercentage int)
- func (sm *SyncMap) SetMapObj(newMap *map[string]interface{})
- type SyncMapWithExpiration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache describes an in-memory cache with automatic expiration
func (Cache) GetVerifyResult ¶
func (Cache) SetVerifyResult ¶
type SyncMap ¶
type SyncMap struct {
// contains filtered or unexported fields
}
SyncMap is a map with synchronized access support
func MakeSyncMap ¶
MakeSyncMap create a new SyncMap if maxEntries is 0, the capacity if override as 1
func (*SyncMap) DeleteEntry ¶
DeleteEntry delete an entry TODO evaluate need for delete
func (*SyncMap) SetEvictionPercentage ¶
SetEvictionPercentage sets the new percentage of entries to be evicted when map reaches its capacity When the map is full during insertion, the minimum number of entries to be evicted will be 1
type SyncMapWithExpiration ¶
type SyncMapWithExpiration struct {
// contains filtered or unexported fields
}
SyncMapWithExpiration enhances SyncMap with expiry-tracked cached items.
func NewSyncMapWithExpiration ¶
func NewSyncMapWithExpiration(maxEntries int) *SyncMapWithExpiration
NewSyncMapWithExpiration creates a new SyncMapWithExpiration.
func (*SyncMapWithExpiration) GetEntry ¶
func (sme *SyncMapWithExpiration) GetEntry(key string) (interface{}, bool)
GetEntry gets an active entry.
Click to show internal directories.
Click to hide internal directories.