Documentation ¶
Overview ¶
Package mocks is a generated GoMock package.
Index ¶
- Constants
- func NotFoundWithCause(e error) error
- type InvalidateOption
- type InvalidateOptions
- type InvalidateOptionsMatcher
- type MockStoreInterface
- func (m *MockStoreInterface) Clear(ctx context.Context) error
- func (m *MockStoreInterface) Delete(ctx context.Context, key any) error
- func (m *MockStoreInterface) EXPECT() *MockStoreInterfaceMockRecorder
- func (m *MockStoreInterface) Get(ctx context.Context, key any) (any, error)
- func (m *MockStoreInterface) GetType() string
- func (m *MockStoreInterface) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)
- func (m *MockStoreInterface) Invalidate(ctx context.Context, options ...InvalidateOption) error
- func (m *MockStoreInterface) Set(ctx context.Context, key, value any, options ...Option) error
- type MockStoreInterfaceMockRecorder
- func (mr *MockStoreInterfaceMockRecorder) Clear(ctx interface{}) *gomock.Call
- func (mr *MockStoreInterfaceMockRecorder) Delete(ctx, key interface{}) *gomock.Call
- func (mr *MockStoreInterfaceMockRecorder) Get(ctx, key interface{}) *gomock.Call
- func (mr *MockStoreInterfaceMockRecorder) GetType() *gomock.Call
- func (mr *MockStoreInterfaceMockRecorder) GetWithTTL(ctx, key interface{}) *gomock.Call
- func (mr *MockStoreInterfaceMockRecorder) Invalidate(ctx interface{}, options ...interface{}) *gomock.Call
- func (mr *MockStoreInterfaceMockRecorder) Set(ctx, key, value interface{}, options ...interface{}) *gomock.Call
- type NotFound
- type Option
- type Options
- type OptionsMatcher
- type StoreInterface
Constants ¶
const NOT_FOUND_ERR string = "value not found in store"
Variables ¶
This section is empty.
Functions ¶
func NotFoundWithCause ¶
Types ¶
type InvalidateOption ¶
type InvalidateOption func(o *InvalidateOptions)
InvalidateOption represents a cache invalidation function.
func WithInvalidateTags ¶
func WithInvalidateTags(tags []string) InvalidateOption
WithInvalidateTags allows setting the invalidate tags.
type InvalidateOptions ¶
type InvalidateOptions struct {
Tags []string
}
func ApplyInvalidateOptions ¶
func ApplyInvalidateOptions(opts ...InvalidateOption) *InvalidateOptions
func ApplyInvalidateOptionsWithDefault ¶
func ApplyInvalidateOptionsWithDefault(defaultOptions *InvalidateOptions, opts ...InvalidateOption) *InvalidateOptions
type InvalidateOptionsMatcher ¶
type InvalidateOptionsMatcher struct {
Tags []string
}
func (InvalidateOptionsMatcher) Matches ¶
func (m InvalidateOptionsMatcher) Matches(x interface{}) bool
func (InvalidateOptionsMatcher) String ¶
func (m InvalidateOptionsMatcher) String() string
type MockStoreInterface ¶
type MockStoreInterface struct {
// contains filtered or unexported fields
}
MockStoreInterface is a mock of StoreInterface interface.
func NewMockStoreInterface ¶
func NewMockStoreInterface(ctrl *gomock.Controller) *MockStoreInterface
NewMockStoreInterface creates a new mock instance.
func (*MockStoreInterface) Clear ¶
func (m *MockStoreInterface) Clear(ctx context.Context) error
Clear mocks base method.
func (*MockStoreInterface) Delete ¶
func (m *MockStoreInterface) Delete(ctx context.Context, key any) error
Delete mocks base method.
func (*MockStoreInterface) EXPECT ¶
func (m *MockStoreInterface) EXPECT() *MockStoreInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStoreInterface) GetType ¶
func (m *MockStoreInterface) GetType() string
GetType mocks base method.
func (*MockStoreInterface) GetWithTTL ¶
GetWithTTL mocks base method.
func (*MockStoreInterface) Invalidate ¶
func (m *MockStoreInterface) Invalidate(ctx context.Context, options ...InvalidateOption) error
Invalidate mocks base method.
type MockStoreInterfaceMockRecorder ¶
type MockStoreInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockStoreInterfaceMockRecorder is the mock recorder for MockStoreInterface.
func (*MockStoreInterfaceMockRecorder) Clear ¶
func (mr *MockStoreInterfaceMockRecorder) Clear(ctx interface{}) *gomock.Call
Clear indicates an expected call of Clear.
func (*MockStoreInterfaceMockRecorder) Delete ¶
func (mr *MockStoreInterfaceMockRecorder) Delete(ctx, key interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockStoreInterfaceMockRecorder) Get ¶
func (mr *MockStoreInterfaceMockRecorder) Get(ctx, key interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockStoreInterfaceMockRecorder) GetType ¶
func (mr *MockStoreInterfaceMockRecorder) GetType() *gomock.Call
GetType indicates an expected call of GetType.
func (*MockStoreInterfaceMockRecorder) GetWithTTL ¶
func (mr *MockStoreInterfaceMockRecorder) GetWithTTL(ctx, key interface{}) *gomock.Call
GetWithTTL indicates an expected call of GetWithTTL.
func (*MockStoreInterfaceMockRecorder) Invalidate ¶
func (mr *MockStoreInterfaceMockRecorder) Invalidate(ctx interface{}, options ...interface{}) *gomock.Call
Invalidate indicates an expected call of Invalidate.
func (*MockStoreInterfaceMockRecorder) Set ¶
func (mr *MockStoreInterfaceMockRecorder) Set(ctx, key, value interface{}, options ...interface{}) *gomock.Call
Set indicates an expected call of Set.
type Option ¶
type Option func(o *Options)
Option represents a store option function.
func WithClientSideCaching ¶
WithClientSideCaching allows setting the client side caching, enabled by default Currently to be used by Rueidis(redis) library only.
func WithCost ¶
WithCost allows setting the memory capacity used by the item when setting a value. Actually it seems to be used by Ristretto library only.
func WithExpiration ¶
WithExpiration allows to specify an expiration time when setting a value.
type Options ¶
type Options struct { Cost int64 Expiration time.Duration Tags []string ClientSideCacheExpiration time.Duration }
func ApplyOptions ¶
func ApplyOptionsWithDefault ¶
type OptionsMatcher ¶
func (OptionsMatcher) Matches ¶
func (m OptionsMatcher) Matches(x interface{}) bool
func (OptionsMatcher) String ¶
func (m OptionsMatcher) String() string
type StoreInterface ¶
type StoreInterface 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, value any, options ...Option) error Delete(ctx context.Context, key any) error Invalidate(ctx context.Context, options ...InvalidateOption) error Clear(ctx context.Context) error GetType() string }
StoreInterface is the interface for all available stores