github.com/lyft/flytestdlib@v0.3.12-0.20210213045714-8cdd111ecda1/utils/mocks/auto_refresh_cache.go (about) 1 // Code generated by mockery v1.0.1. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 utils "github.com/lyft/flytestdlib/utils" 9 mock "github.com/stretchr/testify/mock" 10 ) 11 12 // AutoRefreshCache is an autogenerated mock type for the AutoRefreshCache type 13 type AutoRefreshCache struct { 14 mock.Mock 15 } 16 17 type AutoRefreshCache_Get struct { 18 *mock.Call 19 } 20 21 func (_m AutoRefreshCache_Get) Return(_a0 utils.CacheItem) *AutoRefreshCache_Get { 22 return &AutoRefreshCache_Get{Call: _m.Call.Return(_a0)} 23 } 24 25 func (_m *AutoRefreshCache) OnGet(id string) *AutoRefreshCache_Get { 26 c := _m.On("Get", id) 27 return &AutoRefreshCache_Get{Call: c} 28 } 29 30 func (_m *AutoRefreshCache) OnGetMatch(matchers ...interface{}) *AutoRefreshCache_Get { 31 c := _m.On("Get", matchers...) 32 return &AutoRefreshCache_Get{Call: c} 33 } 34 35 // Get provides a mock function with given fields: id 36 func (_m *AutoRefreshCache) Get(id string) utils.CacheItem { 37 ret := _m.Called(id) 38 39 var r0 utils.CacheItem 40 if rf, ok := ret.Get(0).(func(string) utils.CacheItem); ok { 41 r0 = rf(id) 42 } else { 43 if ret.Get(0) != nil { 44 r0 = ret.Get(0).(utils.CacheItem) 45 } 46 } 47 48 return r0 49 } 50 51 type AutoRefreshCache_GetOrCreate struct { 52 *mock.Call 53 } 54 55 func (_m AutoRefreshCache_GetOrCreate) Return(_a0 utils.CacheItem, _a1 error) *AutoRefreshCache_GetOrCreate { 56 return &AutoRefreshCache_GetOrCreate{Call: _m.Call.Return(_a0, _a1)} 57 } 58 59 func (_m *AutoRefreshCache) OnGetOrCreate(item utils.CacheItem) *AutoRefreshCache_GetOrCreate { 60 c := _m.On("GetOrCreate", item) 61 return &AutoRefreshCache_GetOrCreate{Call: c} 62 } 63 64 func (_m *AutoRefreshCache) OnGetOrCreateMatch(matchers ...interface{}) *AutoRefreshCache_GetOrCreate { 65 c := _m.On("GetOrCreate", matchers...) 66 return &AutoRefreshCache_GetOrCreate{Call: c} 67 } 68 69 // GetOrCreate provides a mock function with given fields: item 70 func (_m *AutoRefreshCache) GetOrCreate(item utils.CacheItem) (utils.CacheItem, error) { 71 ret := _m.Called(item) 72 73 var r0 utils.CacheItem 74 if rf, ok := ret.Get(0).(func(utils.CacheItem) utils.CacheItem); ok { 75 r0 = rf(item) 76 } else { 77 if ret.Get(0) != nil { 78 r0 = ret.Get(0).(utils.CacheItem) 79 } 80 } 81 82 var r1 error 83 if rf, ok := ret.Get(1).(func(utils.CacheItem) error); ok { 84 r1 = rf(item) 85 } else { 86 r1 = ret.Error(1) 87 } 88 89 return r0, r1 90 } 91 92 // Start provides a mock function with given fields: ctx 93 func (_m *AutoRefreshCache) Start(ctx context.Context) { 94 _m.Called(ctx) 95 }