Documentation ¶
Overview ¶
Code generated by MockGen. DO NOT EDIT. Source: cache.go
Generated by this command:
mockgen -source=cache.go -package=cache -destination=mock_cache.go
Package cache is a generated GoMock package.
Index ¶
- func New[T comparable](expiration time.Duration) *cache[T]
- type Cache
- type MockCache
- func (m *MockCache[T]) DeleteExpired()
- func (m *MockCache[T]) EXPECT() *MockCacheMockRecorder[T]
- func (m *MockCache[T]) Get(key T) (any, bool)
- func (m *MockCache[T]) Set(key T, value any)
- func (m *MockCache[T]) StartCollecting(ctx context.Context, interval time.Duration)
- func (m *MockCache[T]) WaitForTermination()
- type MockCacheMockRecorder
- func (mr *MockCacheMockRecorder[T]) DeleteExpired() *gomock.Call
- func (mr *MockCacheMockRecorder[T]) Get(key any) *gomock.Call
- func (mr *MockCacheMockRecorder[T]) Set(key, value any) *gomock.Call
- func (mr *MockCacheMockRecorder[T]) StartCollecting(ctx, interval any) *gomock.Call
- func (mr *MockCacheMockRecorder[T]) WaitForTermination() *gomock.Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New[T comparable](expiration time.Duration) *cache[T]
New returns a new cache with the requested item expiration duration, which automatically removes expired items at the cleanup interval.
Types ¶
type MockCache ¶
type MockCache[T comparable] struct { // contains filtered or unexported fields }
MockCache is a mock of Cache interface.
func NewMockCache ¶
func NewMockCache[T comparable](ctrl *gomock.Controller) *MockCache[T]
NewMockCache creates a new mock instance.
func (*MockCache[T]) DeleteExpired ¶
func (m *MockCache[T]) DeleteExpired()
DeleteExpired mocks base method.
func (*MockCache[T]) EXPECT ¶
func (m *MockCache[T]) EXPECT() *MockCacheMockRecorder[T]
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCache[T]) StartCollecting ¶
StartCollecting mocks base method.
func (*MockCache[T]) WaitForTermination ¶
func (m *MockCache[T]) WaitForTermination()
WaitForTermination mocks base method.
type MockCacheMockRecorder ¶
type MockCacheMockRecorder[T comparable] struct { // contains filtered or unexported fields }
MockCacheMockRecorder is the mock recorder for MockCache.
func (*MockCacheMockRecorder[T]) DeleteExpired ¶
func (mr *MockCacheMockRecorder[T]) DeleteExpired() *gomock.Call
DeleteExpired indicates an expected call of DeleteExpired.
func (*MockCacheMockRecorder[T]) Get ¶
func (mr *MockCacheMockRecorder[T]) Get(key any) *gomock.Call
Get indicates an expected call of Get.
func (*MockCacheMockRecorder[T]) Set ¶
func (mr *MockCacheMockRecorder[T]) Set(key, value any) *gomock.Call
Set indicates an expected call of Set.
func (*MockCacheMockRecorder[T]) StartCollecting ¶
func (mr *MockCacheMockRecorder[T]) StartCollecting(ctx, interval any) *gomock.Call
StartCollecting indicates an expected call of StartCollecting.
func (*MockCacheMockRecorder[T]) WaitForTermination ¶
func (mr *MockCacheMockRecorder[T]) WaitForTermination() *gomock.Call
WaitForTermination indicates an expected call of WaitForTermination.