Documentation ¶
Overview ¶
Package ristretto is a generated GoMock package.
Index ¶
- Constants
- type MockRistrettoClientInterface
- func (m *MockRistrettoClientInterface) Clear()
- func (m *MockRistrettoClientInterface) Del(key any)
- func (m *MockRistrettoClientInterface) EXPECT() *MockRistrettoClientInterfaceMockRecorder
- func (m *MockRistrettoClientInterface) Get(key any) (any, bool)
- func (m *MockRistrettoClientInterface) SetWithTTL(key, value any, cost int64, ttl time.Duration) bool
- func (m *MockRistrettoClientInterface) Wait()
- type MockRistrettoClientInterfaceMockRecorder
- func (mr *MockRistrettoClientInterfaceMockRecorder) Clear() *gomock.Call
- func (mr *MockRistrettoClientInterfaceMockRecorder) Del(key interface{}) *gomock.Call
- func (mr *MockRistrettoClientInterfaceMockRecorder) Get(key interface{}) *gomock.Call
- func (mr *MockRistrettoClientInterfaceMockRecorder) SetWithTTL(key, value, cost, ttl interface{}) *gomock.Call
- func (mr *MockRistrettoClientInterfaceMockRecorder) Wait() *gomock.Call
- type RistrettoClientInterface
- type RistrettoStore
- func (s *RistrettoStore) Clear(_ context.Context) error
- func (s *RistrettoStore) Delete(_ context.Context, key any) error
- func (s *RistrettoStore) Get(_ context.Context, key any) (any, error)
- func (s *RistrettoStore) GetType() string
- func (s *RistrettoStore) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)
- func (s *RistrettoStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
- func (s *RistrettoStore) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error
Constants ¶
const ( // RistrettoType represents the storage type as a string value RistrettoType = "ristretto" // RistrettoTagPattern represents the tag pattern to be used as a key in specified storage RistrettoTagPattern = "gocache_tag_%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockRistrettoClientInterface ¶
type MockRistrettoClientInterface struct {
// contains filtered or unexported fields
}
MockRistrettoClientInterface is a mock of RistrettoClientInterface interface.
func NewMockRistrettoClientInterface ¶
func NewMockRistrettoClientInterface(ctrl *gomock.Controller) *MockRistrettoClientInterface
NewMockRistrettoClientInterface creates a new mock instance.
func (*MockRistrettoClientInterface) Clear ¶
func (m *MockRistrettoClientInterface) Clear()
Clear mocks base method.
func (*MockRistrettoClientInterface) Del ¶
func (m *MockRistrettoClientInterface) Del(key any)
Del mocks base method.
func (*MockRistrettoClientInterface) EXPECT ¶
func (m *MockRistrettoClientInterface) EXPECT() *MockRistrettoClientInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRistrettoClientInterface) Get ¶
func (m *MockRistrettoClientInterface) Get(key any) (any, bool)
Get mocks base method.
func (*MockRistrettoClientInterface) SetWithTTL ¶
func (m *MockRistrettoClientInterface) SetWithTTL(key, value any, cost int64, ttl time.Duration) bool
SetWithTTL mocks base method.
func (*MockRistrettoClientInterface) Wait ¶
func (m *MockRistrettoClientInterface) Wait()
Wait mocks base method.
type MockRistrettoClientInterfaceMockRecorder ¶
type MockRistrettoClientInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockRistrettoClientInterfaceMockRecorder is the mock recorder for MockRistrettoClientInterface.
func (*MockRistrettoClientInterfaceMockRecorder) Clear ¶
func (mr *MockRistrettoClientInterfaceMockRecorder) Clear() *gomock.Call
Clear indicates an expected call of Clear.
func (*MockRistrettoClientInterfaceMockRecorder) Del ¶
func (mr *MockRistrettoClientInterfaceMockRecorder) Del(key interface{}) *gomock.Call
Del indicates an expected call of Del.
func (*MockRistrettoClientInterfaceMockRecorder) Get ¶
func (mr *MockRistrettoClientInterfaceMockRecorder) Get(key interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockRistrettoClientInterfaceMockRecorder) SetWithTTL ¶
func (mr *MockRistrettoClientInterfaceMockRecorder) SetWithTTL(key, value, cost, ttl interface{}) *gomock.Call
SetWithTTL indicates an expected call of SetWithTTL.
func (*MockRistrettoClientInterfaceMockRecorder) Wait ¶
func (mr *MockRistrettoClientInterfaceMockRecorder) Wait() *gomock.Call
Wait indicates an expected call of Wait.
type RistrettoClientInterface ¶
type RistrettoClientInterface interface { Get(key any) (any, bool) SetWithTTL(key, value any, cost int64, ttl time.Duration) bool Del(key any) Clear() Wait() }
RistrettoClientInterface represents a dgraph-io/ristretto client
type RistrettoStore ¶
type RistrettoStore struct {
// contains filtered or unexported fields
}
RistrettoStore is a store for Ristretto (memory) library
func NewRistretto ¶
func NewRistretto(client RistrettoClientInterface, options ...lib_store.Option) *RistrettoStore
NewRistretto creates a new store to Ristretto (memory) library instance
func (*RistrettoStore) Clear ¶
func (s *RistrettoStore) Clear(_ context.Context) error
Clear resets all data in the store
func (*RistrettoStore) Delete ¶
func (s *RistrettoStore) Delete(_ context.Context, key any) error
Delete removes data in Ristretto memory cache for given key identifier
func (*RistrettoStore) GetType ¶
func (s *RistrettoStore) GetType() string
GetType returns the store type
func (*RistrettoStore) GetWithTTL ¶
GetWithTTL returns data stored from a given key and its corresponding TTL
func (*RistrettoStore) Invalidate ¶
func (s *RistrettoStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
Invalidate invalidates some cache data in Redis for given options