Versions in this module Expand all Collapse all v0 v0.0.9 Feb 14, 2022 v0.0.8 Feb 14, 2022 Changes in this version + var ErrCacheNotSameType = errors.New("cached item have is not same type as expected result") + type GenericCache interface + Get func(ctx context.Context, key string, value interface{}) (bool, error) + Set func(ctx context.Context, key string, value interface{}, ttl time.Duration) error + type Mem struct + func NewMemoryCache() *Mem + func (c *Mem) Get(_ context.Context, key string, value interface{}) (bool, error) + func (c *Mem) Set(_ context.Context, key string, value interface{}, ttl time.Duration) error + type MockGenericCache struct + func (_m *MockGenericCache) EXPECT() *MockGenericCache_Expecter + func (_m *MockGenericCache) Get(ctx context.Context, key string, value interface{}) (bool, error) + func (_m *MockGenericCache) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error + type MockGenericCache_Expecter struct + func (_e *MockGenericCache_Expecter) Get(ctx interface{}, key interface{}, value interface{}) *MockGenericCache_Get_Call + func (_e *MockGenericCache_Expecter) Set(ctx interface{}, key interface{}, value interface{}, ttl interface{}) *MockGenericCache_Set_Call + type MockGenericCache_Get_Call struct + func (_c *MockGenericCache_Get_Call) Return(_a0 bool, _a1 error) *MockGenericCache_Get_Call + func (_c *MockGenericCache_Get_Call) Run(run func(ctx context.Context, key string, value interface{})) *MockGenericCache_Get_Call + type MockGenericCache_Set_Call struct + func (_c *MockGenericCache_Set_Call) Return(_a0 error) *MockGenericCache_Set_Call + func (_c *MockGenericCache_Set_Call) Run(...) *MockGenericCache_Set_Call + type Redis struct + func NewRedisCache(cli *redis.Client) Redis + func (c Redis) Get(ctx context.Context, key string, value interface{}) (bool, error) + func (c Redis) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error