Documentation ¶
Overview ¶
Package memcache is a generated GoMock package.
Index ¶
- Constants
- type MemcacheClientInterface
- type MemcacheStore
- func (s *MemcacheStore) Clear(_ context.Context) error
- func (s *MemcacheStore) Delete(_ context.Context, key any) error
- func (s *MemcacheStore) Get(_ context.Context, key any) (any, error)
- func (s *MemcacheStore) GetType() string
- func (s *MemcacheStore) GetWithTTL(_ context.Context, key any) (any, time.Duration, error)
- func (s *MemcacheStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
- func (s *MemcacheStore) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error
- type MockMemcacheClientInterface
- func (m *MockMemcacheClientInterface) Add(item *memcache.Item) error
- func (m *MockMemcacheClientInterface) CompareAndSwap(item *memcache.Item) error
- func (m *MockMemcacheClientInterface) Delete(item string) error
- func (m *MockMemcacheClientInterface) EXPECT() *MockMemcacheClientInterfaceMockRecorder
- func (m *MockMemcacheClientInterface) FlushAll() error
- func (m *MockMemcacheClientInterface) Get(key string) (*memcache.Item, error)
- func (m *MockMemcacheClientInterface) Set(item *memcache.Item) error
- type MockMemcacheClientInterfaceMockRecorder
- func (mr *MockMemcacheClientInterfaceMockRecorder) Add(item interface{}) *gomock.Call
- func (mr *MockMemcacheClientInterfaceMockRecorder) CompareAndSwap(item interface{}) *gomock.Call
- func (mr *MockMemcacheClientInterfaceMockRecorder) Delete(item interface{}) *gomock.Call
- func (mr *MockMemcacheClientInterfaceMockRecorder) FlushAll() *gomock.Call
- func (mr *MockMemcacheClientInterfaceMockRecorder) Get(key interface{}) *gomock.Call
- func (mr *MockMemcacheClientInterfaceMockRecorder) Set(item interface{}) *gomock.Call
Constants ¶
const ( // MemcacheType represents the storage type as a string value MemcacheType = "memcache" // MemcacheTagPattern represents the tag pattern to be used as a key in specified storage MemcacheTagPattern = "gocache_tag_%s" TagKeyExpiry = 720 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemcacheClientInterface ¶
type MemcacheClientInterface interface { Get(key string) (item *memcache.Item, err error) Set(item *memcache.Item) error Delete(item string) error FlushAll() error CompareAndSwap(item *memcache.Item) error Add(item *memcache.Item) error }
MemcacheClientInterface represents a bradfitz/gomemcache client
type MemcacheStore ¶
type MemcacheStore struct {
// contains filtered or unexported fields
}
MemcacheStore is a store for Memcache
func NewMemcache ¶
func NewMemcache(client MemcacheClientInterface, options ...lib_store.Option) *MemcacheStore
NewMemcache creates a new store to Memcache instance(s)
func (*MemcacheStore) Clear ¶
func (s *MemcacheStore) Clear(_ context.Context) error
Clear resets all data in the store
func (*MemcacheStore) Delete ¶
func (s *MemcacheStore) Delete(_ context.Context, key any) error
Delete removes data from Memcache for given key identifier
func (*MemcacheStore) GetType ¶
func (s *MemcacheStore) GetType() string
GetType returns the store type
func (*MemcacheStore) GetWithTTL ¶
GetWithTTL returns data stored from a given key and its corresponding TTL
func (*MemcacheStore) Invalidate ¶
func (s *MemcacheStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
Invalidate invalidates some cache data in Memcache for given options
type MockMemcacheClientInterface ¶
type MockMemcacheClientInterface struct {
// contains filtered or unexported fields
}
MockMemcacheClientInterface is a mock of MemcacheClientInterface interface.
func NewMockMemcacheClientInterface ¶
func NewMockMemcacheClientInterface(ctrl *gomock.Controller) *MockMemcacheClientInterface
NewMockMemcacheClientInterface creates a new mock instance.
func (*MockMemcacheClientInterface) Add ¶
func (m *MockMemcacheClientInterface) Add(item *memcache.Item) error
Add mocks base method.
func (*MockMemcacheClientInterface) CompareAndSwap ¶
func (m *MockMemcacheClientInterface) CompareAndSwap(item *memcache.Item) error
CompareAndSwap mocks base method.
func (*MockMemcacheClientInterface) Delete ¶
func (m *MockMemcacheClientInterface) Delete(item string) error
Delete mocks base method.
func (*MockMemcacheClientInterface) EXPECT ¶
func (m *MockMemcacheClientInterface) EXPECT() *MockMemcacheClientInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMemcacheClientInterface) FlushAll ¶
func (m *MockMemcacheClientInterface) FlushAll() error
FlushAll mocks base method.
type MockMemcacheClientInterfaceMockRecorder ¶
type MockMemcacheClientInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockMemcacheClientInterfaceMockRecorder is the mock recorder for MockMemcacheClientInterface.
func (*MockMemcacheClientInterfaceMockRecorder) Add ¶
func (mr *MockMemcacheClientInterfaceMockRecorder) Add(item interface{}) *gomock.Call
Add indicates an expected call of Add.
func (*MockMemcacheClientInterfaceMockRecorder) CompareAndSwap ¶
func (mr *MockMemcacheClientInterfaceMockRecorder) CompareAndSwap(item interface{}) *gomock.Call
CompareAndSwap indicates an expected call of CompareAndSwap.
func (*MockMemcacheClientInterfaceMockRecorder) Delete ¶
func (mr *MockMemcacheClientInterfaceMockRecorder) Delete(item interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockMemcacheClientInterfaceMockRecorder) FlushAll ¶
func (mr *MockMemcacheClientInterfaceMockRecorder) FlushAll() *gomock.Call
FlushAll indicates an expected call of FlushAll.
func (*MockMemcacheClientInterfaceMockRecorder) Get ¶
func (mr *MockMemcacheClientInterfaceMockRecorder) Get(key interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockMemcacheClientInterfaceMockRecorder) Set ¶
func (mr *MockMemcacheClientInterfaceMockRecorder) Set(item interface{}) *gomock.Call
Set indicates an expected call of Set.