Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generic ¶
type Generic interface { Get(ctx context.Context, key string, value interface{}) (bool, error) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error }
func NewMemoryCache ¶
func NewMemoryCache() Generic
NewMemoryCache return an in-memory cache. This cache backend should be used to cache limited-sized entries like user group permission rule.
func NewRedisCache ¶
func NewRedisCache(cli *redis.Client) Generic
NewRedisCache create a redis backed cache.
type MockGeneric ¶
MockGeneric is an autogenerated mock type for the Generic type
func (*MockGeneric) EXPECT ¶
func (_m *MockGeneric) EXPECT() *MockGeneric_Expecter
type MockGeneric_Expecter ¶
type MockGeneric_Expecter struct {
// contains filtered or unexported fields
}
func (*MockGeneric_Expecter) Get ¶
func (_e *MockGeneric_Expecter) Get(ctx interface{}, key interface{}, value interface{}) *MockGeneric_Get_Call
Get is a helper method to define mock.On call
- ctx context.Context
- key string
- value interface{}
func (*MockGeneric_Expecter) Set ¶
func (_e *MockGeneric_Expecter) Set(ctx interface{}, key interface{}, value interface{}, ttl interface{}) *MockGeneric_Set_Call
Set is a helper method to define mock.On call
- ctx context.Context
- key string
- value interface{}
- ttl time.Duration
type MockGeneric_Get_Call ¶
MockGeneric_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockGeneric_Get_Call) Return ¶
func (_c *MockGeneric_Get_Call) Return(_a0 bool, _a1 error) *MockGeneric_Get_Call
func (*MockGeneric_Get_Call) Run ¶
func (_c *MockGeneric_Get_Call) Run(run func(ctx context.Context, key string, value interface{})) *MockGeneric_Get_Call
type MockGeneric_Set_Call ¶
MockGeneric_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set'
func (*MockGeneric_Set_Call) Return ¶
func (_c *MockGeneric_Set_Call) Return(_a0 error) *MockGeneric_Set_Call
func (*MockGeneric_Set_Call) Run ¶
func (_c *MockGeneric_Set_Call) Run(run func(ctx context.Context, key string, value interface{}, ttl time.Duration)) *MockGeneric_Set_Call
Click to show internal directories.
Click to hide internal directories.