Documentation
¶
Index ¶
- func NewCache() cache.Cache
- func NewSizedCache(capacity int) cache.Cache
- type MemoryCache
- func (c *MemoryCache) Dump() string
- func (c *MemoryCache) Exists(key string) bool
- func (c *MemoryCache) Full() bool
- func (c *MemoryCache) Get(key string) (record *r.Record, err error)
- func (c *MemoryCache) Length() int
- func (c *MemoryCache) Remove(key string)
- func (c *MemoryCache) Set(key string, record *r.Record) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSizedCache ¶
Types ¶
type MemoryCache ¶
type MemoryCache struct { sync.RWMutex Records map[string]*r.Record `json:"cache"` Capacity int `json:"capacity"` }
MemoryCache type
func (*MemoryCache) Dump ¶
func (c *MemoryCache) Dump() string
func (*MemoryCache) Exists ¶
func (c *MemoryCache) Exists(key string) bool
func (*MemoryCache) Full ¶
func (c *MemoryCache) Full() bool
func (*MemoryCache) Length ¶
func (c *MemoryCache) Length() int
func (*MemoryCache) Remove ¶
func (c *MemoryCache) Remove(key string)
Click to show internal directories.
Click to hide internal directories.