1// Code generated by counterfeiter. DO NOT EDIT.
2package dbfakes
3
4import (
5	"sync"
6
7	"code.cloudfoundry.org/lager"
8	"github.com/concourse/concourse/atc/db"
9)
10
11type FakeResourceCacheLifecycle struct {
12	CleanBuildImageResourceCachesStub        func(lager.Logger) error
13	cleanBuildImageResourceCachesMutex       sync.RWMutex
14	cleanBuildImageResourceCachesArgsForCall []struct {
15		arg1 lager.Logger
16	}
17	cleanBuildImageResourceCachesReturns struct {
18		result1 error
19	}
20	cleanBuildImageResourceCachesReturnsOnCall map[int]struct {
21		result1 error
22	}
23	CleanUpInvalidCachesStub        func(lager.Logger) error
24	cleanUpInvalidCachesMutex       sync.RWMutex
25	cleanUpInvalidCachesArgsForCall []struct {
26		arg1 lager.Logger
27	}
28	cleanUpInvalidCachesReturns struct {
29		result1 error
30	}
31	cleanUpInvalidCachesReturnsOnCall map[int]struct {
32		result1 error
33	}
34	CleanUsesForFinishedBuildsStub        func(lager.Logger) error
35	cleanUsesForFinishedBuildsMutex       sync.RWMutex
36	cleanUsesForFinishedBuildsArgsForCall []struct {
37		arg1 lager.Logger
38	}
39	cleanUsesForFinishedBuildsReturns struct {
40		result1 error
41	}
42	cleanUsesForFinishedBuildsReturnsOnCall map[int]struct {
43		result1 error
44	}
45	invocations      map[string][][]interface{}
46	invocationsMutex sync.RWMutex
47}
48
49func (fake *FakeResourceCacheLifecycle) CleanBuildImageResourceCaches(arg1 lager.Logger) error {
50	fake.cleanBuildImageResourceCachesMutex.Lock()
51	ret, specificReturn := fake.cleanBuildImageResourceCachesReturnsOnCall[len(fake.cleanBuildImageResourceCachesArgsForCall)]
52	fake.cleanBuildImageResourceCachesArgsForCall = append(fake.cleanBuildImageResourceCachesArgsForCall, struct {
53		arg1 lager.Logger
54	}{arg1})
55	fake.recordInvocation("CleanBuildImageResourceCaches", []interface{}{arg1})
56	fake.cleanBuildImageResourceCachesMutex.Unlock()
57	if fake.CleanBuildImageResourceCachesStub != nil {
58		return fake.CleanBuildImageResourceCachesStub(arg1)
59	}
60	if specificReturn {
61		return ret.result1
62	}
63	fakeReturns := fake.cleanBuildImageResourceCachesReturns
64	return fakeReturns.result1
65}
66
67func (fake *FakeResourceCacheLifecycle) CleanBuildImageResourceCachesCallCount() int {
68	fake.cleanBuildImageResourceCachesMutex.RLock()
69	defer fake.cleanBuildImageResourceCachesMutex.RUnlock()
70	return len(fake.cleanBuildImageResourceCachesArgsForCall)
71}
72
73func (fake *FakeResourceCacheLifecycle) CleanBuildImageResourceCachesCalls(stub func(lager.Logger) error) {
74	fake.cleanBuildImageResourceCachesMutex.Lock()
75	defer fake.cleanBuildImageResourceCachesMutex.Unlock()
76	fake.CleanBuildImageResourceCachesStub = stub
77}
78
79func (fake *FakeResourceCacheLifecycle) CleanBuildImageResourceCachesArgsForCall(i int) lager.Logger {
80	fake.cleanBuildImageResourceCachesMutex.RLock()
81	defer fake.cleanBuildImageResourceCachesMutex.RUnlock()
82	argsForCall := fake.cleanBuildImageResourceCachesArgsForCall[i]
83	return argsForCall.arg1
84}
85
86func (fake *FakeResourceCacheLifecycle) CleanBuildImageResourceCachesReturns(result1 error) {
87	fake.cleanBuildImageResourceCachesMutex.Lock()
88	defer fake.cleanBuildImageResourceCachesMutex.Unlock()
89	fake.CleanBuildImageResourceCachesStub = nil
90	fake.cleanBuildImageResourceCachesReturns = struct {
91		result1 error
92	}{result1}
93}
94
95func (fake *FakeResourceCacheLifecycle) CleanBuildImageResourceCachesReturnsOnCall(i int, result1 error) {
96	fake.cleanBuildImageResourceCachesMutex.Lock()
97	defer fake.cleanBuildImageResourceCachesMutex.Unlock()
98	fake.CleanBuildImageResourceCachesStub = nil
99	if fake.cleanBuildImageResourceCachesReturnsOnCall == nil {
100		fake.cleanBuildImageResourceCachesReturnsOnCall = make(map[int]struct {
101			result1 error
102		})
103	}
104	fake.cleanBuildImageResourceCachesReturnsOnCall[i] = struct {
105		result1 error
106	}{result1}
107}
108
109func (fake *FakeResourceCacheLifecycle) CleanUpInvalidCaches(arg1 lager.Logger) error {
110	fake.cleanUpInvalidCachesMutex.Lock()
111	ret, specificReturn := fake.cleanUpInvalidCachesReturnsOnCall[len(fake.cleanUpInvalidCachesArgsForCall)]
112	fake.cleanUpInvalidCachesArgsForCall = append(fake.cleanUpInvalidCachesArgsForCall, struct {
113		arg1 lager.Logger
114	}{arg1})
115	fake.recordInvocation("CleanUpInvalidCaches", []interface{}{arg1})
116	fake.cleanUpInvalidCachesMutex.Unlock()
117	if fake.CleanUpInvalidCachesStub != nil {
118		return fake.CleanUpInvalidCachesStub(arg1)
119	}
120	if specificReturn {
121		return ret.result1
122	}
123	fakeReturns := fake.cleanUpInvalidCachesReturns
124	return fakeReturns.result1
125}
126
127func (fake *FakeResourceCacheLifecycle) CleanUpInvalidCachesCallCount() int {
128	fake.cleanUpInvalidCachesMutex.RLock()
129	defer fake.cleanUpInvalidCachesMutex.RUnlock()
130	return len(fake.cleanUpInvalidCachesArgsForCall)
131}
132
133func (fake *FakeResourceCacheLifecycle) CleanUpInvalidCachesCalls(stub func(lager.Logger) error) {
134	fake.cleanUpInvalidCachesMutex.Lock()
135	defer fake.cleanUpInvalidCachesMutex.Unlock()
136	fake.CleanUpInvalidCachesStub = stub
137}
138
139func (fake *FakeResourceCacheLifecycle) CleanUpInvalidCachesArgsForCall(i int) lager.Logger {
140	fake.cleanUpInvalidCachesMutex.RLock()
141	defer fake.cleanUpInvalidCachesMutex.RUnlock()
142	argsForCall := fake.cleanUpInvalidCachesArgsForCall[i]
143	return argsForCall.arg1
144}
145
146func (fake *FakeResourceCacheLifecycle) CleanUpInvalidCachesReturns(result1 error) {
147	fake.cleanUpInvalidCachesMutex.Lock()
148	defer fake.cleanUpInvalidCachesMutex.Unlock()
149	fake.CleanUpInvalidCachesStub = nil
150	fake.cleanUpInvalidCachesReturns = struct {
151		result1 error
152	}{result1}
153}
154
155func (fake *FakeResourceCacheLifecycle) CleanUpInvalidCachesReturnsOnCall(i int, result1 error) {
156	fake.cleanUpInvalidCachesMutex.Lock()
157	defer fake.cleanUpInvalidCachesMutex.Unlock()
158	fake.CleanUpInvalidCachesStub = nil
159	if fake.cleanUpInvalidCachesReturnsOnCall == nil {
160		fake.cleanUpInvalidCachesReturnsOnCall = make(map[int]struct {
161			result1 error
162		})
163	}
164	fake.cleanUpInvalidCachesReturnsOnCall[i] = struct {
165		result1 error
166	}{result1}
167}
168
169func (fake *FakeResourceCacheLifecycle) CleanUsesForFinishedBuilds(arg1 lager.Logger) error {
170	fake.cleanUsesForFinishedBuildsMutex.Lock()
171	ret, specificReturn := fake.cleanUsesForFinishedBuildsReturnsOnCall[len(fake.cleanUsesForFinishedBuildsArgsForCall)]
172	fake.cleanUsesForFinishedBuildsArgsForCall = append(fake.cleanUsesForFinishedBuildsArgsForCall, struct {
173		arg1 lager.Logger
174	}{arg1})
175	fake.recordInvocation("CleanUsesForFinishedBuilds", []interface{}{arg1})
176	fake.cleanUsesForFinishedBuildsMutex.Unlock()
177	if fake.CleanUsesForFinishedBuildsStub != nil {
178		return fake.CleanUsesForFinishedBuildsStub(arg1)
179	}
180	if specificReturn {
181		return ret.result1
182	}
183	fakeReturns := fake.cleanUsesForFinishedBuildsReturns
184	return fakeReturns.result1
185}
186
187func (fake *FakeResourceCacheLifecycle) CleanUsesForFinishedBuildsCallCount() int {
188	fake.cleanUsesForFinishedBuildsMutex.RLock()
189	defer fake.cleanUsesForFinishedBuildsMutex.RUnlock()
190	return len(fake.cleanUsesForFinishedBuildsArgsForCall)
191}
192
193func (fake *FakeResourceCacheLifecycle) CleanUsesForFinishedBuildsCalls(stub func(lager.Logger) error) {
194	fake.cleanUsesForFinishedBuildsMutex.Lock()
195	defer fake.cleanUsesForFinishedBuildsMutex.Unlock()
196	fake.CleanUsesForFinishedBuildsStub = stub
197}
198
199func (fake *FakeResourceCacheLifecycle) CleanUsesForFinishedBuildsArgsForCall(i int) lager.Logger {
200	fake.cleanUsesForFinishedBuildsMutex.RLock()
201	defer fake.cleanUsesForFinishedBuildsMutex.RUnlock()
202	argsForCall := fake.cleanUsesForFinishedBuildsArgsForCall[i]
203	return argsForCall.arg1
204}
205
206func (fake *FakeResourceCacheLifecycle) CleanUsesForFinishedBuildsReturns(result1 error) {
207	fake.cleanUsesForFinishedBuildsMutex.Lock()
208	defer fake.cleanUsesForFinishedBuildsMutex.Unlock()
209	fake.CleanUsesForFinishedBuildsStub = nil
210	fake.cleanUsesForFinishedBuildsReturns = struct {
211		result1 error
212	}{result1}
213}
214
215func (fake *FakeResourceCacheLifecycle) CleanUsesForFinishedBuildsReturnsOnCall(i int, result1 error) {
216	fake.cleanUsesForFinishedBuildsMutex.Lock()
217	defer fake.cleanUsesForFinishedBuildsMutex.Unlock()
218	fake.CleanUsesForFinishedBuildsStub = nil
219	if fake.cleanUsesForFinishedBuildsReturnsOnCall == nil {
220		fake.cleanUsesForFinishedBuildsReturnsOnCall = make(map[int]struct {
221			result1 error
222		})
223	}
224	fake.cleanUsesForFinishedBuildsReturnsOnCall[i] = struct {
225		result1 error
226	}{result1}
227}
228
229func (fake *FakeResourceCacheLifecycle) Invocations() map[string][][]interface{} {
230	fake.invocationsMutex.RLock()
231	defer fake.invocationsMutex.RUnlock()
232	fake.cleanBuildImageResourceCachesMutex.RLock()
233	defer fake.cleanBuildImageResourceCachesMutex.RUnlock()
234	fake.cleanUpInvalidCachesMutex.RLock()
235	defer fake.cleanUpInvalidCachesMutex.RUnlock()
236	fake.cleanUsesForFinishedBuildsMutex.RLock()
237	defer fake.cleanUsesForFinishedBuildsMutex.RUnlock()
238	copiedInvocations := map[string][][]interface{}{}
239	for key, value := range fake.invocations {
240		copiedInvocations[key] = value
241	}
242	return copiedInvocations
243}
244
245func (fake *FakeResourceCacheLifecycle) recordInvocation(key string, args []interface{}) {
246	fake.invocationsMutex.Lock()
247	defer fake.invocationsMutex.Unlock()
248	if fake.invocations == nil {
249		fake.invocations = map[string][][]interface{}{}
250	}
251	if fake.invocations[key] == nil {
252		fake.invocations[key] = [][]interface{}{}
253	}
254	fake.invocations[key] = append(fake.invocations[key], args)
255}
256
257var _ db.ResourceCacheLifecycle = new(FakeResourceCacheLifecycle)
258