Documentation ¶
Index ¶
- type Repository
- func (r *Repository) Clear() (err error)
- func (r *Repository) Contains(key string) (ok bool)
- func (r *Repository) Delete(key string) (ok bool, err error)
- func (r *Repository) Get(key string) (res *cache.Document, err error)
- func (r *Repository) Keys() (keys []string, err error)
- func (r *Repository) Len() int
- func (r *Repository) Set(doc *cache.Document) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository represent the data repository for inernal cache
func New ¶
func New(maxSize, maxMemory uint64, expiryTreshold time.Duration) (repo *Repository)
New will initialize the LFU memory cache
func (*Repository) Clear ¶
func (r *Repository) Clear() (err error)
Clear will clear up the item from cache
func (*Repository) Contains ¶
func (r *Repository) Contains(key string) (ok bool)
Contains check if any item with the given key exist in the cache
func (*Repository) Delete ¶
func (r *Repository) Delete(key string) (ok bool, err error)
Delete will delete the item from cache
func (*Repository) Get ¶
func (r *Repository) Get(key string) (res *cache.Document, err error)
Get will retrieve the item from cache
func (*Repository) Keys ¶
func (r *Repository) Keys() (keys []string, err error)
Keys return all keys from cache
Click to show internal directories.
Click to hide internal directories.