28 lines
526 B
Go
28 lines
526 B
Go
package mocks
|
|
|
|
import (
|
|
"github.com/stretchr/testify/mock"
|
|
"time"
|
|
)
|
|
|
|
type MockCacheClient struct {
|
|
mock.Mock
|
|
}
|
|
|
|
func (m *MockCacheClient) PutWithTtl(key string, value interface{}, time time.Duration) {
|
|
m.Called(key, value, time)
|
|
}
|
|
|
|
func (m *MockCacheClient) PutWithDefaultTtl(key string, value interface{}) {
|
|
m.Called(key, value)
|
|
}
|
|
|
|
func (m *MockCacheClient) Get(key string) (interface{}, bool) {
|
|
args := m.Called(key)
|
|
return args.Get(0), args.Bool(1)
|
|
}
|
|
|
|
func (m *MockCacheClient) Delete(key string) {
|
|
m.Called(key)
|
|
}
|