github.com/craicoverflow/tyk@v2.9.6-rc3+incompatible/dnscache/mock_storage.go (about) 1 package dnscache 2 3 type MockStorage struct { 4 MockFetchItem func(key string) ([]string, error) 5 MockGet func(key string) (DnsCacheItem, bool) 6 MockSet func(key string, addrs []string) 7 MockDelete func(key string) 8 MockClear func() 9 } 10 11 func (ms *MockStorage) FetchItem(key string) ([]string, error) { 12 return ms.MockFetchItem(key) 13 } 14 15 func (ms *MockStorage) Get(key string) (DnsCacheItem, bool) { 16 return ms.MockGet(key) 17 } 18 19 func (ms *MockStorage) Set(key string, addrs []string) { 20 ms.MockSet(key, addrs) 21 } 22 23 func (ms *MockStorage) Delete(key string) { 24 ms.MockDelete(key) 25 } 26 27 func (ms *MockStorage) Clear() { 28 ms.MockClear() 29 }