Documentation ¶
Overview ¶
Package go_cache is a generated GoMock package.
Index ¶
- Constants
- type GoCacheClientInterface
- type GoCacheStore
- func (s *GoCacheStore) Clear(_ context.Context) error
- func (s *GoCacheStore) Delete(_ context.Context, key any) error
- func (s *GoCacheStore) Get(_ context.Context, key any) (any, error)
- func (s *GoCacheStore) GetType() string
- func (s *GoCacheStore) GetWithTTL(_ context.Context, key any) (any, time.Duration, error)
- func (s *GoCacheStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
- func (s *GoCacheStore) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error
- type MockGoCacheClientInterface
- func (m *MockGoCacheClientInterface) Delete(k string)
- func (m *MockGoCacheClientInterface) EXPECT() *MockGoCacheClientInterfaceMockRecorder
- func (m *MockGoCacheClientInterface) Flush()
- func (m *MockGoCacheClientInterface) Get(k string) (any, bool)
- func (m *MockGoCacheClientInterface) GetWithExpiration(k string) (any, time.Time, bool)
- func (m *MockGoCacheClientInterface) Set(k string, x any, d time.Duration)
- type MockGoCacheClientInterfaceMockRecorder
- func (mr *MockGoCacheClientInterfaceMockRecorder) Delete(k interface{}) *gomock.Call
- func (mr *MockGoCacheClientInterfaceMockRecorder) Flush() *gomock.Call
- func (mr *MockGoCacheClientInterfaceMockRecorder) Get(k interface{}) *gomock.Call
- func (mr *MockGoCacheClientInterfaceMockRecorder) GetWithExpiration(k interface{}) *gomock.Call
- func (mr *MockGoCacheClientInterfaceMockRecorder) Set(k, x, d interface{}) *gomock.Call
Constants ¶
const ( // GoCacheType represents the storage type as a string value GoCacheType = "go-cache" // GoCacheTagPattern represents the tag pattern to be used as a key in specified storage GoCacheTagPattern = "gocache_tag_%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoCacheClientInterface ¶
type GoCacheClientInterface interface { Get(k string) (any, bool) GetWithExpiration(k string) (any, time.Time, bool) Set(k string, x any, d time.Duration) Delete(k string) Flush() }
GoCacheClientInterface represents a github.com/patrickmn/go-cache client
type GoCacheStore ¶
type GoCacheStore struct {
// contains filtered or unexported fields
}
GoCacheStore is a store for GoCache (memory) library
func NewGoCache ¶
func NewGoCache(client GoCacheClientInterface, options ...lib_store.Option) *GoCacheStore
NewGoCache creates a new store to GoCache (memory) library instance
func (*GoCacheStore) Clear ¶
func (s *GoCacheStore) Clear(_ context.Context) error
Clear resets all data in the store
func (*GoCacheStore) Delete ¶
func (s *GoCacheStore) Delete(_ context.Context, key any) error
Delete removes data in GoCache memoey cache for given key identifier
func (*GoCacheStore) GetType ¶
func (s *GoCacheStore) GetType() string
GetType returns the store type
func (*GoCacheStore) GetWithTTL ¶
GetWithTTL returns data stored from a given key and its corresponding TTL
func (*GoCacheStore) Invalidate ¶
func (s *GoCacheStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
Invalidate invalidates some cache data in GoCache memoey cache for given options
type MockGoCacheClientInterface ¶
type MockGoCacheClientInterface struct {
// contains filtered or unexported fields
}
MockGoCacheClientInterface is a mock of GoCacheClientInterface interface.
func NewMockGoCacheClientInterface ¶
func NewMockGoCacheClientInterface(ctrl *gomock.Controller) *MockGoCacheClientInterface
NewMockGoCacheClientInterface creates a new mock instance.
func (*MockGoCacheClientInterface) Delete ¶
func (m *MockGoCacheClientInterface) Delete(k string)
Delete mocks base method.
func (*MockGoCacheClientInterface) EXPECT ¶
func (m *MockGoCacheClientInterface) EXPECT() *MockGoCacheClientInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockGoCacheClientInterface) Flush ¶
func (m *MockGoCacheClientInterface) Flush()
Flush mocks base method.
func (*MockGoCacheClientInterface) Get ¶
func (m *MockGoCacheClientInterface) Get(k string) (any, bool)
Get mocks base method.
func (*MockGoCacheClientInterface) GetWithExpiration ¶
GetWithExpiration mocks base method.
type MockGoCacheClientInterfaceMockRecorder ¶
type MockGoCacheClientInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockGoCacheClientInterfaceMockRecorder is the mock recorder for MockGoCacheClientInterface.
func (*MockGoCacheClientInterfaceMockRecorder) Delete ¶
func (mr *MockGoCacheClientInterfaceMockRecorder) Delete(k interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockGoCacheClientInterfaceMockRecorder) Flush ¶
func (mr *MockGoCacheClientInterfaceMockRecorder) Flush() *gomock.Call
Flush indicates an expected call of Flush.
func (*MockGoCacheClientInterfaceMockRecorder) Get ¶
func (mr *MockGoCacheClientInterfaceMockRecorder) Get(k interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockGoCacheClientInterfaceMockRecorder) GetWithExpiration ¶
func (mr *MockGoCacheClientInterfaceMockRecorder) GetWithExpiration(k interface{}) *gomock.Call
GetWithExpiration indicates an expected call of GetWithExpiration.
func (*MockGoCacheClientInterfaceMockRecorder) Set ¶
func (mr *MockGoCacheClientInterfaceMockRecorder) Set(k, x, d interface{}) *gomock.Call
Set indicates an expected call of Set.