Documentation
¶
Overview ¶
Package cache is a generated GoMock package.
Index ¶
- type Cache
- type CacheKeyGenerator
- type MockCache
- func (m *MockCache) Clear(ctx context.Context) error
- func (m *MockCache) Delete(ctx context.Context, key any) error
- func (m *MockCache) EXPECT() *MockCacheMockRecorder
- func (m *MockCache) Get(ctx context.Context, key any) (any, error)
- func (m *MockCache) GetStats() *Stats
- func (m *MockCache) GetStore() store.Store
- func (m *MockCache) GetType() string
- func (m *MockCache) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)
- func (m *MockCache) Invalidate(ctx context.Context, options ...store.InvalidateOption) error
- func (m *MockCache) Set(ctx context.Context, key, object any, options ...store.Option) error
- type MockCacheKeyGenerator
- type MockCacheKeyGeneratorMockRecorder
- type MockCacheMockRecorder
- func (mr *MockCacheMockRecorder) Clear(ctx any) *gomock.Call
- func (mr *MockCacheMockRecorder) Delete(ctx, key any) *gomock.Call
- func (mr *MockCacheMockRecorder) Get(ctx, key any) *gomock.Call
- func (mr *MockCacheMockRecorder) GetStats() *gomock.Call
- func (mr *MockCacheMockRecorder) GetStore() *gomock.Call
- func (mr *MockCacheMockRecorder) GetType() *gomock.Call
- func (mr *MockCacheMockRecorder) GetWithTTL(ctx, key any) *gomock.Call
- func (mr *MockCacheMockRecorder) Invalidate(ctx any, options ...any) *gomock.Call
- func (mr *MockCacheMockRecorder) Set(ctx, key, object any, options ...any) *gomock.Call
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Get(ctx context.Context, key any) (any, error) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error) Set(ctx context.Context, key any, object any, options ...store.Option) error Delete(ctx context.Context, key any) error Invalidate(ctx context.Context, options ...store.InvalidateOption) error Clear(ctx context.Context) error GetType() string GetStore() store.Store GetStats() *Stats // contains filtered or unexported methods }
Cache is an interface for a cache with methods to get, set, delete, invalidate, and clear cache entries.
var DefaultCache Cache
type CacheKeyGenerator ¶
type CacheKeyGenerator interface {
GetCacheKey() string
}
CacheKeyGenerator is an interface for generating cache keys.
type MockCache ¶
type MockCache struct {
// contains filtered or unexported fields
}
MockCache is a mock of Cache interface.
func NewMockCache ¶
func NewMockCache(ctrl *gomock.Controller) *MockCache
NewMockCache creates a new mock instance.
func (*MockCache) EXPECT ¶
func (m *MockCache) EXPECT() *MockCacheMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCache) GetWithTTL ¶
GetWithTTL mocks base method.
func (*MockCache) Invalidate ¶
Invalidate mocks base method.
type MockCacheKeyGenerator ¶
type MockCacheKeyGenerator struct {
// contains filtered or unexported fields
}
MockCacheKeyGenerator is a mock of CacheKeyGenerator interface.
func NewMockCacheKeyGenerator ¶
func NewMockCacheKeyGenerator(ctrl *gomock.Controller) *MockCacheKeyGenerator
NewMockCacheKeyGenerator creates a new mock instance.
func (*MockCacheKeyGenerator) EXPECT ¶
func (m *MockCacheKeyGenerator) EXPECT() *MockCacheKeyGeneratorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCacheKeyGenerator) GetCacheKey ¶
func (m *MockCacheKeyGenerator) GetCacheKey() string
GetCacheKey mocks base method.
type MockCacheKeyGeneratorMockRecorder ¶
type MockCacheKeyGeneratorMockRecorder struct {
// contains filtered or unexported fields
}
MockCacheKeyGeneratorMockRecorder is the mock recorder for MockCacheKeyGenerator.
func (*MockCacheKeyGeneratorMockRecorder) GetCacheKey ¶
func (mr *MockCacheKeyGeneratorMockRecorder) GetCacheKey() *gomock.Call
GetCacheKey indicates an expected call of GetCacheKey.
type MockCacheMockRecorder ¶
type MockCacheMockRecorder struct {
// contains filtered or unexported fields
}
MockCacheMockRecorder is the mock recorder for MockCache.
func (*MockCacheMockRecorder) Clear ¶
func (mr *MockCacheMockRecorder) Clear(ctx any) *gomock.Call
Clear indicates an expected call of Clear.
func (*MockCacheMockRecorder) Delete ¶
func (mr *MockCacheMockRecorder) Delete(ctx, key any) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockCacheMockRecorder) Get ¶
func (mr *MockCacheMockRecorder) Get(ctx, key any) *gomock.Call
Get indicates an expected call of Get.
func (*MockCacheMockRecorder) GetStats ¶
func (mr *MockCacheMockRecorder) GetStats() *gomock.Call
GetStats indicates an expected call of GetStats.
func (*MockCacheMockRecorder) GetStore ¶
func (mr *MockCacheMockRecorder) GetStore() *gomock.Call
GetStore indicates an expected call of GetStore.
func (*MockCacheMockRecorder) GetType ¶
func (mr *MockCacheMockRecorder) GetType() *gomock.Call
GetType indicates an expected call of GetType.
func (*MockCacheMockRecorder) GetWithTTL ¶
func (mr *MockCacheMockRecorder) GetWithTTL(ctx, key any) *gomock.Call
GetWithTTL indicates an expected call of GetWithTTL.
func (*MockCacheMockRecorder) Invalidate ¶
func (mr *MockCacheMockRecorder) Invalidate(ctx any, options ...any) *gomock.Call
Invalidate indicates an expected call of Invalidate.