Documentation ¶
Index ¶
- Variables
- type CacheResponse
- type MemoryCacheInstance
- func (cache *MemoryCacheInstance[Key, T]) Delete(key Key)
- func (cache *MemoryCacheInstance[Key, T]) Get(key Key) (T, bool)
- func (cache *MemoryCacheInstance[Key, T]) GetAll() (CacheResponse[Key, T], error)
- func (cache *MemoryCacheInstance[Key, T]) GetCacheAge() *time.Duration
- func (cache *MemoryCacheInstance[Key, T]) GetLastUpdated() *time.Time
- func (cache *MemoryCacheInstance[Key, T]) Replace(freshData map[Key]T)
- func (cache *MemoryCacheInstance[Key, T]) Reset()
- func (cache *MemoryCacheInstance[Key, T]) Update(key Key, item T)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CacheResponse ¶
type CacheResponse[Key comparable, T any] struct { LastUpdated *time.Time `json:"lastUpdated"` Items map[Key]T `json:"items"` }
type MemoryCacheInstance ¶
type MemoryCacheInstance[Key comparable, T any] struct { // contains filtered or unexported fields }
func NewMemoryCacheInstance ¶
func NewMemoryCacheInstance[Key comparable, T any](maxAllowedAge *time.Duration) *MemoryCacheInstance[Key, T]
func (*MemoryCacheInstance[Key, T]) Delete ¶
func (cache *MemoryCacheInstance[Key, T]) Delete(key Key)
func (*MemoryCacheInstance[Key, T]) Get ¶
func (cache *MemoryCacheInstance[Key, T]) Get(key Key) (T, bool)
func (*MemoryCacheInstance[Key, T]) GetAll ¶
func (cache *MemoryCacheInstance[Key, T]) GetAll() (CacheResponse[Key, T], error)
func (*MemoryCacheInstance[Key, T]) GetCacheAge ¶
func (cache *MemoryCacheInstance[Key, T]) GetCacheAge() *time.Duration
func (*MemoryCacheInstance[Key, T]) GetLastUpdated ¶
func (cache *MemoryCacheInstance[Key, T]) GetLastUpdated() *time.Time
func (*MemoryCacheInstance[Key, T]) Replace ¶
func (cache *MemoryCacheInstance[Key, T]) Replace(freshData map[Key]T)
func (*MemoryCacheInstance[Key, T]) Reset ¶
func (cache *MemoryCacheInstance[Key, T]) Reset()
func (*MemoryCacheInstance[Key, T]) Update ¶
func (cache *MemoryCacheInstance[Key, T]) Update(key Key, item T)
Click to show internal directories.
Click to hide internal directories.