Documentation
¶
Overview ¶
DigiStratum GoLib - Cache
Index ¶
- func NewCacheItem(key string, value interface{}, expires chrono.TimeStampIfc) *cacheItem
- type Cache
- func (r *Cache) Close() error
- func (r *Cache) Configure(config cfg.ConfigIfc) error
- func (r *Cache) Count() int
- func (r *Cache) Drop(key string) (bool, error)
- func (r *Cache) DropAll(keys *[]string) (int, error)
- func (r *Cache) Flush()
- func (r *Cache) Get(key string) interface{}
- func (r *Cache) GetExpires(key string) chrono.TimeStampIfc
- func (r *Cache) GetKeys() []string
- func (r *Cache) Has(key string) bool
- func (r *Cache) HasAll(keys *[]string) bool
- func (r *Cache) IsEmpty() bool
- func (r *Cache) IsRunning() bool
- func (r *Cache) Run()
- func (r *Cache) Set(key string, value interface{}) bool
- func (r *Cache) SetExpires(key string, expires chrono.TimeStampIfc) bool
- func (r *Cache) SetTimeSource(timeSource chrono.TimeSourceIfc)
- func (r *Cache) Size() int64
- func (r *Cache) Stop()
- type CacheIfc
- type CacheItemIfc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCacheItem ¶
func NewCacheItem(key string, value interface{}, expires chrono.TimeStampIfc) *cacheItem
------------------------------------------------------------------------------------------------- Factory Functions -------------------------------------------------------------------------------------------------
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) Drop ¶
Drop an item from the cache with the supplied key return true if we drop it, else false
func (*Cache) DropAll ¶
Check whether we have configuration elements for all the key names return count of items actually dropped
func (*Cache) GetExpires ¶
func (r *Cache) GetExpires(key string) chrono.TimeStampIfc
Get the expiration timestamp for a given Cache item; returns nil if not set
func (*Cache) SetExpires ¶
func (r *Cache) SetExpires(key string, expires chrono.TimeStampIfc) bool
Set the expiration timestamp for a given Cache item; returns true if set, else false
func (*Cache) SetTimeSource ¶
func (r *Cache) SetTimeSource(timeSource chrono.TimeSourceIfc)
type CacheIfc ¶
type CacheIfc interface { Configure(config cfg.ConfigIfc) error // cfg.ConfigurableIfc SetTimeSource(timeSource chrono.TimeSourceIfc) IsEmpty() bool Size() int64 Count() int Set(key string, value interface{}) bool SetExpires(key string, expires chrono.TimeStampIfc) bool GetExpires(key string) chrono.TimeStampIfc Get(key string) interface{} GetKeys() []string Has(key string) bool HasAll(keys *[]string) bool Drop(key string) (bool, error) DropAll(keys *[]string) (int, error) Flush() Close() error }
type CacheItemIfc ¶
type CacheItemIfc interface { IsExpired() bool SetExpires(expires chrono.TimeStampIfc) GetExpires() chrono.TimeStampIfc GetValue() interface{} GetKey() string Size() int64 }
Click to show internal directories.
Click to hide internal directories.