Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacherMock ¶
CacherMock is an autogenerated mock type for the Cacher type
func NewCacherMock ¶
func NewCacherMock[K interface{}, V interface{}](t mockConstructorTestingTNewCacherMock) *CacherMock[K, V]
NewCacherMock creates a new instance of CacherMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*CacherMock[K, V]) Clear ¶
func (_m *CacherMock[K, V]) Clear()
Clear provides a mock function with given fields:
func (*CacherMock[K, V]) Delete ¶
func (_m *CacherMock[K, V]) Delete(key K)
Delete provides a mock function with given fields: key
func (*CacherMock[K, V]) Get ¶
func (_m *CacherMock[K, V]) Get(key K) (V, bool)
Get provides a mock function with given fields: key
func (*CacherMock[K, V]) Len ¶
func (_m *CacherMock[K, V]) Len() int
Len provides a mock function with given fields:
func (*CacherMock[K, V]) Set ¶
func (_m *CacherMock[K, V]) Set(key K, value V)
Set provides a mock function with given fields: key, value
type LRUCache ¶
type LRUCache[K, V any] struct { // contains filtered or unexported fields }
LRUCache is Least Recently Used (LRU) cache.
func NewLRUCache ¶
type LRUCacheExpiry ¶ added in v0.2.0
type LRUCacheExpiry[K, V any] struct { LRUCache[K, ValueWithExpiry[V]] // contains filtered or unexported fields }
LRUCacheExpiry is Least Recently Used (LRU) cache.
func NewLRUCacheExpiry ¶ added in v0.2.0
func NewLRUCacheExpiry[K, V any](capacity int, options Options) *LRUCacheExpiry[K, V]
func (*LRUCacheExpiry[K, V]) Get ¶ added in v0.2.0
func (c *LRUCacheExpiry[K, V]) Get(key K) (value V, ok bool)
func (*LRUCacheExpiry[K, V]) Set ¶ added in v0.2.0
func (c *LRUCacheExpiry[K, V]) Set(key K, value V)
type ValueWithExpiry ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.