forked from vmware-archive/atc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_volume_factory_db.go
216 lines (194 loc) · 6.78 KB
/
fake_volume_factory_db.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// This file was generated by counterfeiter
package workerfakes
import (
"sync"
"time"
"github.com/concourse/atc/worker"
)
type FakeVolumeFactoryDB struct {
GetVolumeTTLStub func(volumeHandle string) (time.Duration, bool, error)
getVolumeTTLMutex sync.RWMutex
getVolumeTTLArgsForCall []struct {
volumeHandle string
}
getVolumeTTLReturns struct {
result1 time.Duration
result2 bool
result3 error
}
ReapVolumeStub func(handle string) error
reapVolumeMutex sync.RWMutex
reapVolumeArgsForCall []struct {
handle string
}
reapVolumeReturns struct {
result1 error
}
SetVolumeTTLAndSizeInBytesStub func(handle string, ttl time.Duration, sizeInBytes int64) error
setVolumeTTLAndSizeInBytesMutex sync.RWMutex
setVolumeTTLAndSizeInBytesArgsForCall []struct {
handle string
ttl time.Duration
sizeInBytes int64
}
setVolumeTTLAndSizeInBytesReturns struct {
result1 error
}
SetVolumeTTLStub func(handle string, ttl time.Duration) error
setVolumeTTLMutex sync.RWMutex
setVolumeTTLArgsForCall []struct {
handle string
ttl time.Duration
}
setVolumeTTLReturns struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeVolumeFactoryDB) GetVolumeTTL(volumeHandle string) (time.Duration, bool, error) {
fake.getVolumeTTLMutex.Lock()
fake.getVolumeTTLArgsForCall = append(fake.getVolumeTTLArgsForCall, struct {
volumeHandle string
}{volumeHandle})
fake.recordInvocation("GetVolumeTTL", []interface{}{volumeHandle})
fake.getVolumeTTLMutex.Unlock()
if fake.GetVolumeTTLStub != nil {
return fake.GetVolumeTTLStub(volumeHandle)
} else {
return fake.getVolumeTTLReturns.result1, fake.getVolumeTTLReturns.result2, fake.getVolumeTTLReturns.result3
}
}
func (fake *FakeVolumeFactoryDB) GetVolumeTTLCallCount() int {
fake.getVolumeTTLMutex.RLock()
defer fake.getVolumeTTLMutex.RUnlock()
return len(fake.getVolumeTTLArgsForCall)
}
func (fake *FakeVolumeFactoryDB) GetVolumeTTLArgsForCall(i int) string {
fake.getVolumeTTLMutex.RLock()
defer fake.getVolumeTTLMutex.RUnlock()
return fake.getVolumeTTLArgsForCall[i].volumeHandle
}
func (fake *FakeVolumeFactoryDB) GetVolumeTTLReturns(result1 time.Duration, result2 bool, result3 error) {
fake.GetVolumeTTLStub = nil
fake.getVolumeTTLReturns = struct {
result1 time.Duration
result2 bool
result3 error
}{result1, result2, result3}
}
func (fake *FakeVolumeFactoryDB) ReapVolume(handle string) error {
fake.reapVolumeMutex.Lock()
fake.reapVolumeArgsForCall = append(fake.reapVolumeArgsForCall, struct {
handle string
}{handle})
fake.recordInvocation("ReapVolume", []interface{}{handle})
fake.reapVolumeMutex.Unlock()
if fake.ReapVolumeStub != nil {
return fake.ReapVolumeStub(handle)
} else {
return fake.reapVolumeReturns.result1
}
}
func (fake *FakeVolumeFactoryDB) ReapVolumeCallCount() int {
fake.reapVolumeMutex.RLock()
defer fake.reapVolumeMutex.RUnlock()
return len(fake.reapVolumeArgsForCall)
}
func (fake *FakeVolumeFactoryDB) ReapVolumeArgsForCall(i int) string {
fake.reapVolumeMutex.RLock()
defer fake.reapVolumeMutex.RUnlock()
return fake.reapVolumeArgsForCall[i].handle
}
func (fake *FakeVolumeFactoryDB) ReapVolumeReturns(result1 error) {
fake.ReapVolumeStub = nil
fake.reapVolumeReturns = struct {
result1 error
}{result1}
}
func (fake *FakeVolumeFactoryDB) SetVolumeTTLAndSizeInBytes(handle string, ttl time.Duration, sizeInBytes int64) error {
fake.setVolumeTTLAndSizeInBytesMutex.Lock()
fake.setVolumeTTLAndSizeInBytesArgsForCall = append(fake.setVolumeTTLAndSizeInBytesArgsForCall, struct {
handle string
ttl time.Duration
sizeInBytes int64
}{handle, ttl, sizeInBytes})
fake.recordInvocation("SetVolumeTTLAndSizeInBytes", []interface{}{handle, ttl, sizeInBytes})
fake.setVolumeTTLAndSizeInBytesMutex.Unlock()
if fake.SetVolumeTTLAndSizeInBytesStub != nil {
return fake.SetVolumeTTLAndSizeInBytesStub(handle, ttl, sizeInBytes)
} else {
return fake.setVolumeTTLAndSizeInBytesReturns.result1
}
}
func (fake *FakeVolumeFactoryDB) SetVolumeTTLAndSizeInBytesCallCount() int {
fake.setVolumeTTLAndSizeInBytesMutex.RLock()
defer fake.setVolumeTTLAndSizeInBytesMutex.RUnlock()
return len(fake.setVolumeTTLAndSizeInBytesArgsForCall)
}
func (fake *FakeVolumeFactoryDB) SetVolumeTTLAndSizeInBytesArgsForCall(i int) (string, time.Duration, int64) {
fake.setVolumeTTLAndSizeInBytesMutex.RLock()
defer fake.setVolumeTTLAndSizeInBytesMutex.RUnlock()
return fake.setVolumeTTLAndSizeInBytesArgsForCall[i].handle, fake.setVolumeTTLAndSizeInBytesArgsForCall[i].ttl, fake.setVolumeTTLAndSizeInBytesArgsForCall[i].sizeInBytes
}
func (fake *FakeVolumeFactoryDB) SetVolumeTTLAndSizeInBytesReturns(result1 error) {
fake.SetVolumeTTLAndSizeInBytesStub = nil
fake.setVolumeTTLAndSizeInBytesReturns = struct {
result1 error
}{result1}
}
func (fake *FakeVolumeFactoryDB) SetVolumeTTL(handle string, ttl time.Duration) error {
fake.setVolumeTTLMutex.Lock()
fake.setVolumeTTLArgsForCall = append(fake.setVolumeTTLArgsForCall, struct {
handle string
ttl time.Duration
}{handle, ttl})
fake.recordInvocation("SetVolumeTTL", []interface{}{handle, ttl})
fake.setVolumeTTLMutex.Unlock()
if fake.SetVolumeTTLStub != nil {
return fake.SetVolumeTTLStub(handle, ttl)
} else {
return fake.setVolumeTTLReturns.result1
}
}
func (fake *FakeVolumeFactoryDB) SetVolumeTTLCallCount() int {
fake.setVolumeTTLMutex.RLock()
defer fake.setVolumeTTLMutex.RUnlock()
return len(fake.setVolumeTTLArgsForCall)
}
func (fake *FakeVolumeFactoryDB) SetVolumeTTLArgsForCall(i int) (string, time.Duration) {
fake.setVolumeTTLMutex.RLock()
defer fake.setVolumeTTLMutex.RUnlock()
return fake.setVolumeTTLArgsForCall[i].handle, fake.setVolumeTTLArgsForCall[i].ttl
}
func (fake *FakeVolumeFactoryDB) SetVolumeTTLReturns(result1 error) {
fake.SetVolumeTTLStub = nil
fake.setVolumeTTLReturns = struct {
result1 error
}{result1}
}
func (fake *FakeVolumeFactoryDB) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.getVolumeTTLMutex.RLock()
defer fake.getVolumeTTLMutex.RUnlock()
fake.reapVolumeMutex.RLock()
defer fake.reapVolumeMutex.RUnlock()
fake.setVolumeTTLAndSizeInBytesMutex.RLock()
defer fake.setVolumeTTLAndSizeInBytesMutex.RUnlock()
fake.setVolumeTTLMutex.RLock()
defer fake.setVolumeTTLMutex.RUnlock()
return fake.invocations
}
func (fake *FakeVolumeFactoryDB) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ worker.VolumeFactoryDB = new(FakeVolumeFactoryDB)