Documentation ¶
Index ¶
- type Cache
- func (_m *Cache[T]) Contains(key string) bool
- func (_m *Cache[T]) EXPECT() *Cache_Expecter[T]
- func (_m *Cache[T]) Expire(key string) bool
- func (_m *Cache[T]) Get(key string) (T, bool)
- func (_m *Cache[T]) Provide(key string, provider func() T) T
- func (_m *Cache[T]) ProvideWithError(key string, provider func() (T, error)) (T, error)
- func (_m *Cache[T]) Set(key string, value T)
- func (_m *Cache[T]) SetX(key string, value T, ttl time.Duration)
- type Cache_Contains_Call
- type Cache_Expecter
- func (_e *Cache_Expecter[T]) Contains(key interface{}) *Cache_Contains_Call[T]
- func (_e *Cache_Expecter[T]) Expire(key interface{}) *Cache_Expire_Call[T]
- func (_e *Cache_Expecter[T]) Get(key interface{}) *Cache_Get_Call[T]
- func (_e *Cache_Expecter[T]) Provide(key interface{}, provider interface{}) *Cache_Provide_Call[T]
- func (_e *Cache_Expecter[T]) ProvideWithError(key interface{}, provider interface{}) *Cache_ProvideWithError_Call[T]
- func (_e *Cache_Expecter[T]) Set(key interface{}, value interface{}) *Cache_Set_Call[T]
- func (_e *Cache_Expecter[T]) SetX(key interface{}, value interface{}, ttl interface{}) *Cache_SetX_Call[T]
- type Cache_Expire_Call
- type Cache_Get_Call
- type Cache_ProvideWithError_Call
- func (_c *Cache_ProvideWithError_Call[T]) Return(_a0 T, _a1 error) *Cache_ProvideWithError_Call[T]
- func (_c *Cache_ProvideWithError_Call[T]) Run(run func(key string, provider func() (T, error))) *Cache_ProvideWithError_Call[T]
- func (_c *Cache_ProvideWithError_Call[T]) RunAndReturn(run func(string, func() (T, error)) (T, error)) *Cache_ProvideWithError_Call[T]
- type Cache_Provide_Call
- type Cache_SetX_Call
- type Cache_Set_Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache is an autogenerated mock type for the Cache type
func NewCache ¶
NewCache creates a new instance of Cache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*Cache[T]) EXPECT ¶
func (_m *Cache[T]) EXPECT() *Cache_Expecter[T]
func (*Cache[T]) ProvideWithError ¶
ProvideWithError provides a mock function with given fields: key, provider
type Cache_Contains_Call ¶
Cache_Contains_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Contains'
func (*Cache_Contains_Call[T]) Return ¶
func (_c *Cache_Contains_Call[T]) Return(_a0 bool) *Cache_Contains_Call[T]
func (*Cache_Contains_Call[T]) Run ¶
func (_c *Cache_Contains_Call[T]) Run(run func(key string)) *Cache_Contains_Call[T]
func (*Cache_Contains_Call[T]) RunAndReturn ¶
func (_c *Cache_Contains_Call[T]) RunAndReturn(run func(string) bool) *Cache_Contains_Call[T]
type Cache_Expecter ¶
type Cache_Expecter[T interface{}] struct {
// contains filtered or unexported fields
}
func (*Cache_Expecter[T]) Contains ¶
func (_e *Cache_Expecter[T]) Contains(key interface{}) *Cache_Contains_Call[T]
Contains is a helper method to define mock.On call
- key string
func (*Cache_Expecter[T]) Expire ¶
func (_e *Cache_Expecter[T]) Expire(key interface{}) *Cache_Expire_Call[T]
Expire is a helper method to define mock.On call
- key string
func (*Cache_Expecter[T]) Get ¶
func (_e *Cache_Expecter[T]) Get(key interface{}) *Cache_Get_Call[T]
Get is a helper method to define mock.On call
- key string
func (*Cache_Expecter[T]) Provide ¶
func (_e *Cache_Expecter[T]) Provide(key interface{}, provider interface{}) *Cache_Provide_Call[T]
Provide is a helper method to define mock.On call
- key string
- provider func() T
func (*Cache_Expecter[T]) ProvideWithError ¶
func (_e *Cache_Expecter[T]) ProvideWithError(key interface{}, provider interface{}) *Cache_ProvideWithError_Call[T]
ProvideWithError is a helper method to define mock.On call
- key string
- provider func()(T , error)
func (*Cache_Expecter[T]) Set ¶
func (_e *Cache_Expecter[T]) Set(key interface{}, value interface{}) *Cache_Set_Call[T]
Set is a helper method to define mock.On call
- key string
- value T
func (*Cache_Expecter[T]) SetX ¶
func (_e *Cache_Expecter[T]) SetX(key interface{}, value interface{}, ttl interface{}) *Cache_SetX_Call[T]
SetX is a helper method to define mock.On call
- key string
- value T
- ttl time.Duration
type Cache_Expire_Call ¶
Cache_Expire_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Expire'
func (*Cache_Expire_Call[T]) Return ¶
func (_c *Cache_Expire_Call[T]) Return(_a0 bool) *Cache_Expire_Call[T]
func (*Cache_Expire_Call[T]) Run ¶
func (_c *Cache_Expire_Call[T]) Run(run func(key string)) *Cache_Expire_Call[T]
func (*Cache_Expire_Call[T]) RunAndReturn ¶
func (_c *Cache_Expire_Call[T]) RunAndReturn(run func(string) bool) *Cache_Expire_Call[T]
type Cache_Get_Call ¶
Cache_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*Cache_Get_Call[T]) Return ¶
func (_c *Cache_Get_Call[T]) Return(_a0 T, _a1 bool) *Cache_Get_Call[T]
func (*Cache_Get_Call[T]) Run ¶
func (_c *Cache_Get_Call[T]) Run(run func(key string)) *Cache_Get_Call[T]
func (*Cache_Get_Call[T]) RunAndReturn ¶
func (_c *Cache_Get_Call[T]) RunAndReturn(run func(string) (T, bool)) *Cache_Get_Call[T]
type Cache_ProvideWithError_Call ¶
Cache_ProvideWithError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProvideWithError'
func (*Cache_ProvideWithError_Call[T]) Return ¶
func (_c *Cache_ProvideWithError_Call[T]) Return(_a0 T, _a1 error) *Cache_ProvideWithError_Call[T]
func (*Cache_ProvideWithError_Call[T]) Run ¶
func (_c *Cache_ProvideWithError_Call[T]) Run(run func(key string, provider func() (T, error))) *Cache_ProvideWithError_Call[T]
func (*Cache_ProvideWithError_Call[T]) RunAndReturn ¶
func (_c *Cache_ProvideWithError_Call[T]) RunAndReturn(run func(string, func() (T, error)) (T, error)) *Cache_ProvideWithError_Call[T]
type Cache_Provide_Call ¶
Cache_Provide_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Provide'
func (*Cache_Provide_Call[T]) Return ¶
func (_c *Cache_Provide_Call[T]) Return(_a0 T) *Cache_Provide_Call[T]
func (*Cache_Provide_Call[T]) Run ¶
func (_c *Cache_Provide_Call[T]) Run(run func(key string, provider func() T)) *Cache_Provide_Call[T]
func (*Cache_Provide_Call[T]) RunAndReturn ¶
func (_c *Cache_Provide_Call[T]) RunAndReturn(run func(string, func() T) T) *Cache_Provide_Call[T]
type Cache_SetX_Call ¶
Cache_SetX_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetX'
func (*Cache_SetX_Call[T]) Return ¶
func (_c *Cache_SetX_Call[T]) Return() *Cache_SetX_Call[T]
func (*Cache_SetX_Call[T]) Run ¶
func (_c *Cache_SetX_Call[T]) Run(run func(key string, value T, ttl time.Duration)) *Cache_SetX_Call[T]
func (*Cache_SetX_Call[T]) RunAndReturn ¶
func (_c *Cache_SetX_Call[T]) RunAndReturn(run func(string, T, time.Duration)) *Cache_SetX_Call[T]
type Cache_Set_Call ¶
Cache_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set'
func (*Cache_Set_Call[T]) Return ¶
func (_c *Cache_Set_Call[T]) Return() *Cache_Set_Call[T]
func (*Cache_Set_Call[T]) Run ¶
func (_c *Cache_Set_Call[T]) Run(run func(key string, value T)) *Cache_Set_Call[T]
func (*Cache_Set_Call[T]) RunAndReturn ¶
func (_c *Cache_Set_Call[T]) RunAndReturn(run func(string, T)) *Cache_Set_Call[T]