Documentation
¶
Overview ¶
Package store is a generated GoMock package.
Index ¶
- Constants
- func NotFoundWithCause(e error) error
- type InvalidateOption
- type InvalidateOptions
- type InvalidateOptionsMatcher
- type MockStore
- func (m *MockStore) Clear(ctx context.Context) error
- func (m *MockStore) Delete(ctx context.Context, key any) error
- func (m *MockStore) EXPECT() *MockStoreMockRecorder
- func (m *MockStore) Get(ctx context.Context, key any) (any, error)
- func (m *MockStore) GetType() string
- func (m *MockStore) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)
- func (m *MockStore) Invalidate(ctx context.Context, options ...InvalidateOption) error
- func (m *MockStore) Set(ctx context.Context, key, value any, options ...Option) error
- type MockStoreMockRecorder
- func (mr *MockStoreMockRecorder) Clear(ctx any) *gomock.Call
- func (mr *MockStoreMockRecorder) Delete(ctx, key any) *gomock.Call
- func (mr *MockStoreMockRecorder) Get(ctx, key any) *gomock.Call
- func (mr *MockStoreMockRecorder) GetType() *gomock.Call
- func (mr *MockStoreMockRecorder) GetWithTTL(ctx, key any) *gomock.Call
- func (mr *MockStoreMockRecorder) Invalidate(ctx any, options ...any) *gomock.Call
- func (mr *MockStoreMockRecorder) Set(ctx, key, value any, options ...any) *gomock.Call
- type NotFound
- type Option
- type Options
- type OptionsMatcher
- type Store
Constants ¶
const NOT_FOUND_ERR string = "value not found in store"
NOT_FOUND_ERR is the error message for "value not found in store"
Variables ¶
This section is empty.
Functions ¶
func NotFoundWithCause ¶
NotFoundWithCause creates a new NotFound error with a cause.
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 MockStore ¶
type MockStore struct {
// contains filtered or unexported fields
}
MockStore is a mock of Store interface.
func NewMockStore ¶
func NewMockStore(ctrl *gomock.Controller) *MockStore
NewMockStore creates a new mock instance.
func (*MockStore) EXPECT ¶
func (m *MockStore) EXPECT() *MockStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStore) GetWithTTL ¶
GetWithTTL mocks base method.
func (*MockStore) Invalidate ¶
func (m *MockStore) Invalidate(ctx context.Context, options ...InvalidateOption) error
Invalidate mocks base method.
type MockStoreMockRecorder ¶
type MockStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockStoreMockRecorder is the mock recorder for MockStore.
func (*MockStoreMockRecorder) Clear ¶
func (mr *MockStoreMockRecorder) Clear(ctx any) *gomock.Call
Clear indicates an expected call of Clear.
func (*MockStoreMockRecorder) Delete ¶
func (mr *MockStoreMockRecorder) Delete(ctx, key any) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockStoreMockRecorder) Get ¶
func (mr *MockStoreMockRecorder) Get(ctx, key any) *gomock.Call
Get indicates an expected call of Get.
func (*MockStoreMockRecorder) GetType ¶
func (mr *MockStoreMockRecorder) GetType() *gomock.Call
GetType indicates an expected call of GetType.
func (*MockStoreMockRecorder) GetWithTTL ¶
func (mr *MockStoreMockRecorder) GetWithTTL(ctx, key any) *gomock.Call
GetWithTTL indicates an expected call of GetWithTTL.
func (*MockStoreMockRecorder) Invalidate ¶
func (mr *MockStoreMockRecorder) Invalidate(ctx any, options ...any) *gomock.Call
Invalidate indicates an expected call of Invalidate.
type NotFound ¶
type NotFound struct {
// contains filtered or unexported fields
}
NotFound is an error type representing a "value not found" error.
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.
func WithSynchronousSet ¶
func WithSynchronousSet() Option
WithSynchronousSet allows setting the behavior when setting a value, whether to wait until all buffered writes have been applied or not. Currently to be used by Ristretto library only.
type Options ¶
type Options struct {
SynchronousSet bool
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 Store ¶
type Store 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
}