Documentation ¶
Index ¶
Constants ¶
View Source
const COMPACTION_INTERVAL = 5 * time.Second
Duration between times when we clear out all old data from the memory cache.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
This is a simple in-memory cache that uses prefix trees to insert and retrieve cache items from memory.
func New ¶
func New(maxEntries int) (*MemoryCache, error)
func (*MemoryCache) Close ¶
func (m *MemoryCache) Close()
func (*MemoryCache) Flush ¶
func (m *MemoryCache) Flush() error
func (*MemoryCache) Len ¶
func (m *MemoryCache) Len() uint
func (*MemoryCache) Size ¶
func (m *MemoryCache) Size() uint64
Size will not be accurate for an in-memory Cache
Click to show internal directories.
Click to hide internal directories.