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) GetOldest() (res *cache.Document, err error)
- func (r *Repository) Keys() (keys []string, err error)
- func (r *Repository) Len() (itemLen int64)
- func (r *Repository) Peek(key string) (res *cache.Document, err error)
- 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 implements the Repository cache
func New ¶
func New(size, memory uint64, expiryTresHold time.Duration) *Repository
New constructs an Repository of the given size
func (*Repository) Clear ¶
func (r *Repository) Clear() (err error)
Clear is used to completely clear the cache.
func (*Repository) Contains ¶
func (r *Repository) Contains(key string) (ok bool)
Contains checks if a key is in the cache, without updating the recent-ness or deleting it for being stale.
func (*Repository) Delete ¶
func (r *Repository) Delete(key string) (ok bool, err error)
Delete removes the provided key from the cache, returning if the key was contained.
func (*Repository) Get ¶
func (r *Repository) Get(key string) (res *cache.Document, err error)
Get looks up a key's value from the cache.
func (*Repository) GetOldest ¶
func (r *Repository) GetOldest() (res *cache.Document, err error)
GetOldest returns the oldest element
func (*Repository) Keys ¶
func (r *Repository) Keys() (keys []string, err error)
Keys returns a slice of the keys in the cache, from oldest to newest.
func (*Repository) Len ¶
func (r *Repository) Len() (itemLen int64)
Len returns the number of items in the cache.
Click to show internal directories.
Click to hide internal directories.