1// Code generated by counterfeiter. DO NOT EDIT.
2package releasedirfakes
3
4import (
5	"io"
6	"sync"
7
8	"github.com/cloudfoundry/bosh-cli/releasedir"
9)
10
11type FakeBlobsDir struct {
12	InitStub        func() error
13	initMutex       sync.RWMutex
14	initArgsForCall []struct{}
15	initReturns     struct {
16		result1 error
17	}
18	initReturnsOnCall map[int]struct {
19		result1 error
20	}
21	BlobsStub        func() ([]releasedir.Blob, error)
22	blobsMutex       sync.RWMutex
23	blobsArgsForCall []struct{}
24	blobsReturns     struct {
25		result1 []releasedir.Blob
26		result2 error
27	}
28	blobsReturnsOnCall map[int]struct {
29		result1 []releasedir.Blob
30		result2 error
31	}
32	SyncBlobsStub        func(numOfParallelWorkers int) error
33	syncBlobsMutex       sync.RWMutex
34	syncBlobsArgsForCall []struct {
35		numOfParallelWorkers int
36	}
37	syncBlobsReturns struct {
38		result1 error
39	}
40	syncBlobsReturnsOnCall map[int]struct {
41		result1 error
42	}
43	UploadBlobsStub        func() error
44	uploadBlobsMutex       sync.RWMutex
45	uploadBlobsArgsForCall []struct{}
46	uploadBlobsReturns     struct {
47		result1 error
48	}
49	uploadBlobsReturnsOnCall map[int]struct {
50		result1 error
51	}
52	TrackBlobStub        func(string, io.ReadCloser) (releasedir.Blob, error)
53	trackBlobMutex       sync.RWMutex
54	trackBlobArgsForCall []struct {
55		arg1 string
56		arg2 io.ReadCloser
57	}
58	trackBlobReturns struct {
59		result1 releasedir.Blob
60		result2 error
61	}
62	trackBlobReturnsOnCall map[int]struct {
63		result1 releasedir.Blob
64		result2 error
65	}
66	UntrackBlobStub        func(string) error
67	untrackBlobMutex       sync.RWMutex
68	untrackBlobArgsForCall []struct {
69		arg1 string
70	}
71	untrackBlobReturns struct {
72		result1 error
73	}
74	untrackBlobReturnsOnCall map[int]struct {
75		result1 error
76	}
77	invocations      map[string][][]interface{}
78	invocationsMutex sync.RWMutex
79}
80
81func (fake *FakeBlobsDir) Init() error {
82	fake.initMutex.Lock()
83	ret, specificReturn := fake.initReturnsOnCall[len(fake.initArgsForCall)]
84	fake.initArgsForCall = append(fake.initArgsForCall, struct{}{})
85	fake.recordInvocation("Init", []interface{}{})
86	fake.initMutex.Unlock()
87	if fake.InitStub != nil {
88		return fake.InitStub()
89	}
90	if specificReturn {
91		return ret.result1
92	}
93	return fake.initReturns.result1
94}
95
96func (fake *FakeBlobsDir) InitCallCount() int {
97	fake.initMutex.RLock()
98	defer fake.initMutex.RUnlock()
99	return len(fake.initArgsForCall)
100}
101
102func (fake *FakeBlobsDir) InitReturns(result1 error) {
103	fake.InitStub = nil
104	fake.initReturns = struct {
105		result1 error
106	}{result1}
107}
108
109func (fake *FakeBlobsDir) InitReturnsOnCall(i int, result1 error) {
110	fake.InitStub = nil
111	if fake.initReturnsOnCall == nil {
112		fake.initReturnsOnCall = make(map[int]struct {
113			result1 error
114		})
115	}
116	fake.initReturnsOnCall[i] = struct {
117		result1 error
118	}{result1}
119}
120
121func (fake *FakeBlobsDir) Blobs() ([]releasedir.Blob, error) {
122	fake.blobsMutex.Lock()
123	ret, specificReturn := fake.blobsReturnsOnCall[len(fake.blobsArgsForCall)]
124	fake.blobsArgsForCall = append(fake.blobsArgsForCall, struct{}{})
125	fake.recordInvocation("Blobs", []interface{}{})
126	fake.blobsMutex.Unlock()
127	if fake.BlobsStub != nil {
128		return fake.BlobsStub()
129	}
130	if specificReturn {
131		return ret.result1, ret.result2
132	}
133	return fake.blobsReturns.result1, fake.blobsReturns.result2
134}
135
136func (fake *FakeBlobsDir) BlobsCallCount() int {
137	fake.blobsMutex.RLock()
138	defer fake.blobsMutex.RUnlock()
139	return len(fake.blobsArgsForCall)
140}
141
142func (fake *FakeBlobsDir) BlobsReturns(result1 []releasedir.Blob, result2 error) {
143	fake.BlobsStub = nil
144	fake.blobsReturns = struct {
145		result1 []releasedir.Blob
146		result2 error
147	}{result1, result2}
148}
149
150func (fake *FakeBlobsDir) BlobsReturnsOnCall(i int, result1 []releasedir.Blob, result2 error) {
151	fake.BlobsStub = nil
152	if fake.blobsReturnsOnCall == nil {
153		fake.blobsReturnsOnCall = make(map[int]struct {
154			result1 []releasedir.Blob
155			result2 error
156		})
157	}
158	fake.blobsReturnsOnCall[i] = struct {
159		result1 []releasedir.Blob
160		result2 error
161	}{result1, result2}
162}
163
164func (fake *FakeBlobsDir) SyncBlobs(numOfParallelWorkers int) error {
165	fake.syncBlobsMutex.Lock()
166	ret, specificReturn := fake.syncBlobsReturnsOnCall[len(fake.syncBlobsArgsForCall)]
167	fake.syncBlobsArgsForCall = append(fake.syncBlobsArgsForCall, struct {
168		numOfParallelWorkers int
169	}{numOfParallelWorkers})
170	fake.recordInvocation("SyncBlobs", []interface{}{numOfParallelWorkers})
171	fake.syncBlobsMutex.Unlock()
172	if fake.SyncBlobsStub != nil {
173		return fake.SyncBlobsStub(numOfParallelWorkers)
174	}
175	if specificReturn {
176		return ret.result1
177	}
178	return fake.syncBlobsReturns.result1
179}
180
181func (fake *FakeBlobsDir) SyncBlobsCallCount() int {
182	fake.syncBlobsMutex.RLock()
183	defer fake.syncBlobsMutex.RUnlock()
184	return len(fake.syncBlobsArgsForCall)
185}
186
187func (fake *FakeBlobsDir) SyncBlobsArgsForCall(i int) int {
188	fake.syncBlobsMutex.RLock()
189	defer fake.syncBlobsMutex.RUnlock()
190	return fake.syncBlobsArgsForCall[i].numOfParallelWorkers
191}
192
193func (fake *FakeBlobsDir) SyncBlobsReturns(result1 error) {
194	fake.SyncBlobsStub = nil
195	fake.syncBlobsReturns = struct {
196		result1 error
197	}{result1}
198}
199
200func (fake *FakeBlobsDir) SyncBlobsReturnsOnCall(i int, result1 error) {
201	fake.SyncBlobsStub = nil
202	if fake.syncBlobsReturnsOnCall == nil {
203		fake.syncBlobsReturnsOnCall = make(map[int]struct {
204			result1 error
205		})
206	}
207	fake.syncBlobsReturnsOnCall[i] = struct {
208		result1 error
209	}{result1}
210}
211
212func (fake *FakeBlobsDir) UploadBlobs() error {
213	fake.uploadBlobsMutex.Lock()
214	ret, specificReturn := fake.uploadBlobsReturnsOnCall[len(fake.uploadBlobsArgsForCall)]
215	fake.uploadBlobsArgsForCall = append(fake.uploadBlobsArgsForCall, struct{}{})
216	fake.recordInvocation("UploadBlobs", []interface{}{})
217	fake.uploadBlobsMutex.Unlock()
218	if fake.UploadBlobsStub != nil {
219		return fake.UploadBlobsStub()
220	}
221	if specificReturn {
222		return ret.result1
223	}
224	return fake.uploadBlobsReturns.result1
225}
226
227func (fake *FakeBlobsDir) UploadBlobsCallCount() int {
228	fake.uploadBlobsMutex.RLock()
229	defer fake.uploadBlobsMutex.RUnlock()
230	return len(fake.uploadBlobsArgsForCall)
231}
232
233func (fake *FakeBlobsDir) UploadBlobsReturns(result1 error) {
234	fake.UploadBlobsStub = nil
235	fake.uploadBlobsReturns = struct {
236		result1 error
237	}{result1}
238}
239
240func (fake *FakeBlobsDir) UploadBlobsReturnsOnCall(i int, result1 error) {
241	fake.UploadBlobsStub = nil
242	if fake.uploadBlobsReturnsOnCall == nil {
243		fake.uploadBlobsReturnsOnCall = make(map[int]struct {
244			result1 error
245		})
246	}
247	fake.uploadBlobsReturnsOnCall[i] = struct {
248		result1 error
249	}{result1}
250}
251
252func (fake *FakeBlobsDir) TrackBlob(arg1 string, arg2 io.ReadCloser) (releasedir.Blob, error) {
253	fake.trackBlobMutex.Lock()
254	ret, specificReturn := fake.trackBlobReturnsOnCall[len(fake.trackBlobArgsForCall)]
255	fake.trackBlobArgsForCall = append(fake.trackBlobArgsForCall, struct {
256		arg1 string
257		arg2 io.ReadCloser
258	}{arg1, arg2})
259	fake.recordInvocation("TrackBlob", []interface{}{arg1, arg2})
260	fake.trackBlobMutex.Unlock()
261	if fake.TrackBlobStub != nil {
262		return fake.TrackBlobStub(arg1, arg2)
263	}
264	if specificReturn {
265		return ret.result1, ret.result2
266	}
267	return fake.trackBlobReturns.result1, fake.trackBlobReturns.result2
268}
269
270func (fake *FakeBlobsDir) TrackBlobCallCount() int {
271	fake.trackBlobMutex.RLock()
272	defer fake.trackBlobMutex.RUnlock()
273	return len(fake.trackBlobArgsForCall)
274}
275
276func (fake *FakeBlobsDir) TrackBlobArgsForCall(i int) (string, io.ReadCloser) {
277	fake.trackBlobMutex.RLock()
278	defer fake.trackBlobMutex.RUnlock()
279	return fake.trackBlobArgsForCall[i].arg1, fake.trackBlobArgsForCall[i].arg2
280}
281
282func (fake *FakeBlobsDir) TrackBlobReturns(result1 releasedir.Blob, result2 error) {
283	fake.TrackBlobStub = nil
284	fake.trackBlobReturns = struct {
285		result1 releasedir.Blob
286		result2 error
287	}{result1, result2}
288}
289
290func (fake *FakeBlobsDir) TrackBlobReturnsOnCall(i int, result1 releasedir.Blob, result2 error) {
291	fake.TrackBlobStub = nil
292	if fake.trackBlobReturnsOnCall == nil {
293		fake.trackBlobReturnsOnCall = make(map[int]struct {
294			result1 releasedir.Blob
295			result2 error
296		})
297	}
298	fake.trackBlobReturnsOnCall[i] = struct {
299		result1 releasedir.Blob
300		result2 error
301	}{result1, result2}
302}
303
304func (fake *FakeBlobsDir) UntrackBlob(arg1 string) error {
305	fake.untrackBlobMutex.Lock()
306	ret, specificReturn := fake.untrackBlobReturnsOnCall[len(fake.untrackBlobArgsForCall)]
307	fake.untrackBlobArgsForCall = append(fake.untrackBlobArgsForCall, struct {
308		arg1 string
309	}{arg1})
310	fake.recordInvocation("UntrackBlob", []interface{}{arg1})
311	fake.untrackBlobMutex.Unlock()
312	if fake.UntrackBlobStub != nil {
313		return fake.UntrackBlobStub(arg1)
314	}
315	if specificReturn {
316		return ret.result1
317	}
318	return fake.untrackBlobReturns.result1
319}
320
321func (fake *FakeBlobsDir) UntrackBlobCallCount() int {
322	fake.untrackBlobMutex.RLock()
323	defer fake.untrackBlobMutex.RUnlock()
324	return len(fake.untrackBlobArgsForCall)
325}
326
327func (fake *FakeBlobsDir) UntrackBlobArgsForCall(i int) string {
328	fake.untrackBlobMutex.RLock()
329	defer fake.untrackBlobMutex.RUnlock()
330	return fake.untrackBlobArgsForCall[i].arg1
331}
332
333func (fake *FakeBlobsDir) UntrackBlobReturns(result1 error) {
334	fake.UntrackBlobStub = nil
335	fake.untrackBlobReturns = struct {
336		result1 error
337	}{result1}
338}
339
340func (fake *FakeBlobsDir) UntrackBlobReturnsOnCall(i int, result1 error) {
341	fake.UntrackBlobStub = nil
342	if fake.untrackBlobReturnsOnCall == nil {
343		fake.untrackBlobReturnsOnCall = make(map[int]struct {
344			result1 error
345		})
346	}
347	fake.untrackBlobReturnsOnCall[i] = struct {
348		result1 error
349	}{result1}
350}
351
352func (fake *FakeBlobsDir) Invocations() map[string][][]interface{} {
353	fake.invocationsMutex.RLock()
354	defer fake.invocationsMutex.RUnlock()
355	fake.initMutex.RLock()
356	defer fake.initMutex.RUnlock()
357	fake.blobsMutex.RLock()
358	defer fake.blobsMutex.RUnlock()
359	fake.syncBlobsMutex.RLock()
360	defer fake.syncBlobsMutex.RUnlock()
361	fake.uploadBlobsMutex.RLock()
362	defer fake.uploadBlobsMutex.RUnlock()
363	fake.trackBlobMutex.RLock()
364	defer fake.trackBlobMutex.RUnlock()
365	fake.untrackBlobMutex.RLock()
366	defer fake.untrackBlobMutex.RUnlock()
367	copiedInvocations := map[string][][]interface{}{}
368	for key, value := range fake.invocations {
369		copiedInvocations[key] = value
370	}
371	return copiedInvocations
372}
373
374func (fake *FakeBlobsDir) recordInvocation(key string, args []interface{}) {
375	fake.invocationsMutex.Lock()
376	defer fake.invocationsMutex.Unlock()
377	if fake.invocations == nil {
378		fake.invocations = map[string][][]interface{}{}
379	}
380	if fake.invocations[key] == nil {
381		fake.invocations[key] = [][]interface{}{}
382	}
383	fake.invocations[key] = append(fake.invocations[key], args)
384}
385
386var _ releasedir.BlobsDir = new(FakeBlobsDir)
387