Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Get(key string) (*Item, bool) Set(key string, item *Item) GarbageCollect(timeToExpire time.Duration) }
Cache - basic cache interface
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item - basic cache item representation
type MapCache ¶
type MapCache struct {
// contains filtered or unexported fields
}
MapCache - simplest cache implementation based on map and mutex
func (*MapCache) GarbageCollect ¶
GarbageCollect - each 30 seconds clear stale items, should be started as goroutine
Click to show internal directories.
Click to hide internal directories.