29 lines
No EOL
730 B
Go
29 lines
No EOL
730 B
Go
package testutil
|
|
|
|
import (
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
// MockCache implements the CacheInterface for testing
|
|
type MockCache struct{}
|
|
|
|
func (m *MockCache) Get(key string, destination interface{}) error {
|
|
return errors.New("cache miss") // Always return cache miss for tests
|
|
}
|
|
|
|
func (m *MockCache) Set(key string, value interface{}, expiration *time.Time) error {
|
|
return nil // Always succeed for tests
|
|
}
|
|
|
|
func (m *MockCache) SetWithTTL(key string, value interface{}, ttl time.Duration) error {
|
|
return nil // Always succeed for tests
|
|
}
|
|
|
|
func (m *MockCache) Delete(key string) error {
|
|
return nil // Always succeed for tests
|
|
}
|
|
|
|
func (m *MockCache) Exists(key string) (bool, error) {
|
|
return false, nil // Always return false for tests
|
|
} |