github.com/lzy4123/fabric@v2.1.1+incompatible/core/chaincode/persistence/mock/osfileinfo.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mock 3 4 import ( 5 "os" 6 "sync" 7 "time" 8 ) 9 10 type OSFileInfo struct { 11 IsDirStub func() bool 12 isDirMutex sync.RWMutex 13 isDirArgsForCall []struct { 14 } 15 isDirReturns struct { 16 result1 bool 17 } 18 isDirReturnsOnCall map[int]struct { 19 result1 bool 20 } 21 ModTimeStub func() time.Time 22 modTimeMutex sync.RWMutex 23 modTimeArgsForCall []struct { 24 } 25 modTimeReturns struct { 26 result1 time.Time 27 } 28 modTimeReturnsOnCall map[int]struct { 29 result1 time.Time 30 } 31 ModeStub func() os.FileMode 32 modeMutex sync.RWMutex 33 modeArgsForCall []struct { 34 } 35 modeReturns struct { 36 result1 os.FileMode 37 } 38 modeReturnsOnCall map[int]struct { 39 result1 os.FileMode 40 } 41 NameStub func() string 42 nameMutex sync.RWMutex 43 nameArgsForCall []struct { 44 } 45 nameReturns struct { 46 result1 string 47 } 48 nameReturnsOnCall map[int]struct { 49 result1 string 50 } 51 SizeStub func() int64 52 sizeMutex sync.RWMutex 53 sizeArgsForCall []struct { 54 } 55 sizeReturns struct { 56 result1 int64 57 } 58 sizeReturnsOnCall map[int]struct { 59 result1 int64 60 } 61 SysStub func() interface{} 62 sysMutex sync.RWMutex 63 sysArgsForCall []struct { 64 } 65 sysReturns struct { 66 result1 interface{} 67 } 68 sysReturnsOnCall map[int]struct { 69 result1 interface{} 70 } 71 invocations map[string][][]interface{} 72 invocationsMutex sync.RWMutex 73 } 74 75 func (fake *OSFileInfo) IsDir() bool { 76 fake.isDirMutex.Lock() 77 ret, specificReturn := fake.isDirReturnsOnCall[len(fake.isDirArgsForCall)] 78 fake.isDirArgsForCall = append(fake.isDirArgsForCall, struct { 79 }{}) 80 fake.recordInvocation("IsDir", []interface{}{}) 81 fake.isDirMutex.Unlock() 82 if fake.IsDirStub != nil { 83 return fake.IsDirStub() 84 } 85 if specificReturn { 86 return ret.result1 87 } 88 fakeReturns := fake.isDirReturns 89 return fakeReturns.result1 90 } 91 92 func (fake *OSFileInfo) IsDirCallCount() int { 93 fake.isDirMutex.RLock() 94 defer fake.isDirMutex.RUnlock() 95 return len(fake.isDirArgsForCall) 96 } 97 98 func (fake *OSFileInfo) IsDirCalls(stub func() bool) { 99 fake.isDirMutex.Lock() 100 defer fake.isDirMutex.Unlock() 101 fake.IsDirStub = stub 102 } 103 104 func (fake *OSFileInfo) IsDirReturns(result1 bool) { 105 fake.isDirMutex.Lock() 106 defer fake.isDirMutex.Unlock() 107 fake.IsDirStub = nil 108 fake.isDirReturns = struct { 109 result1 bool 110 }{result1} 111 } 112 113 func (fake *OSFileInfo) IsDirReturnsOnCall(i int, result1 bool) { 114 fake.isDirMutex.Lock() 115 defer fake.isDirMutex.Unlock() 116 fake.IsDirStub = nil 117 if fake.isDirReturnsOnCall == nil { 118 fake.isDirReturnsOnCall = make(map[int]struct { 119 result1 bool 120 }) 121 } 122 fake.isDirReturnsOnCall[i] = struct { 123 result1 bool 124 }{result1} 125 } 126 127 func (fake *OSFileInfo) ModTime() time.Time { 128 fake.modTimeMutex.Lock() 129 ret, specificReturn := fake.modTimeReturnsOnCall[len(fake.modTimeArgsForCall)] 130 fake.modTimeArgsForCall = append(fake.modTimeArgsForCall, struct { 131 }{}) 132 fake.recordInvocation("ModTime", []interface{}{}) 133 fake.modTimeMutex.Unlock() 134 if fake.ModTimeStub != nil { 135 return fake.ModTimeStub() 136 } 137 if specificReturn { 138 return ret.result1 139 } 140 fakeReturns := fake.modTimeReturns 141 return fakeReturns.result1 142 } 143 144 func (fake *OSFileInfo) ModTimeCallCount() int { 145 fake.modTimeMutex.RLock() 146 defer fake.modTimeMutex.RUnlock() 147 return len(fake.modTimeArgsForCall) 148 } 149 150 func (fake *OSFileInfo) ModTimeCalls(stub func() time.Time) { 151 fake.modTimeMutex.Lock() 152 defer fake.modTimeMutex.Unlock() 153 fake.ModTimeStub = stub 154 } 155 156 func (fake *OSFileInfo) ModTimeReturns(result1 time.Time) { 157 fake.modTimeMutex.Lock() 158 defer fake.modTimeMutex.Unlock() 159 fake.ModTimeStub = nil 160 fake.modTimeReturns = struct { 161 result1 time.Time 162 }{result1} 163 } 164 165 func (fake *OSFileInfo) ModTimeReturnsOnCall(i int, result1 time.Time) { 166 fake.modTimeMutex.Lock() 167 defer fake.modTimeMutex.Unlock() 168 fake.ModTimeStub = nil 169 if fake.modTimeReturnsOnCall == nil { 170 fake.modTimeReturnsOnCall = make(map[int]struct { 171 result1 time.Time 172 }) 173 } 174 fake.modTimeReturnsOnCall[i] = struct { 175 result1 time.Time 176 }{result1} 177 } 178 179 func (fake *OSFileInfo) Mode() os.FileMode { 180 fake.modeMutex.Lock() 181 ret, specificReturn := fake.modeReturnsOnCall[len(fake.modeArgsForCall)] 182 fake.modeArgsForCall = append(fake.modeArgsForCall, struct { 183 }{}) 184 fake.recordInvocation("Mode", []interface{}{}) 185 fake.modeMutex.Unlock() 186 if fake.ModeStub != nil { 187 return fake.ModeStub() 188 } 189 if specificReturn { 190 return ret.result1 191 } 192 fakeReturns := fake.modeReturns 193 return fakeReturns.result1 194 } 195 196 func (fake *OSFileInfo) ModeCallCount() int { 197 fake.modeMutex.RLock() 198 defer fake.modeMutex.RUnlock() 199 return len(fake.modeArgsForCall) 200 } 201 202 func (fake *OSFileInfo) ModeCalls(stub func() os.FileMode) { 203 fake.modeMutex.Lock() 204 defer fake.modeMutex.Unlock() 205 fake.ModeStub = stub 206 } 207 208 func (fake *OSFileInfo) ModeReturns(result1 os.FileMode) { 209 fake.modeMutex.Lock() 210 defer fake.modeMutex.Unlock() 211 fake.ModeStub = nil 212 fake.modeReturns = struct { 213 result1 os.FileMode 214 }{result1} 215 } 216 217 func (fake *OSFileInfo) ModeReturnsOnCall(i int, result1 os.FileMode) { 218 fake.modeMutex.Lock() 219 defer fake.modeMutex.Unlock() 220 fake.ModeStub = nil 221 if fake.modeReturnsOnCall == nil { 222 fake.modeReturnsOnCall = make(map[int]struct { 223 result1 os.FileMode 224 }) 225 } 226 fake.modeReturnsOnCall[i] = struct { 227 result1 os.FileMode 228 }{result1} 229 } 230 231 func (fake *OSFileInfo) Name() string { 232 fake.nameMutex.Lock() 233 ret, specificReturn := fake.nameReturnsOnCall[len(fake.nameArgsForCall)] 234 fake.nameArgsForCall = append(fake.nameArgsForCall, struct { 235 }{}) 236 fake.recordInvocation("Name", []interface{}{}) 237 fake.nameMutex.Unlock() 238 if fake.NameStub != nil { 239 return fake.NameStub() 240 } 241 if specificReturn { 242 return ret.result1 243 } 244 fakeReturns := fake.nameReturns 245 return fakeReturns.result1 246 } 247 248 func (fake *OSFileInfo) NameCallCount() int { 249 fake.nameMutex.RLock() 250 defer fake.nameMutex.RUnlock() 251 return len(fake.nameArgsForCall) 252 } 253 254 func (fake *OSFileInfo) NameCalls(stub func() string) { 255 fake.nameMutex.Lock() 256 defer fake.nameMutex.Unlock() 257 fake.NameStub = stub 258 } 259 260 func (fake *OSFileInfo) NameReturns(result1 string) { 261 fake.nameMutex.Lock() 262 defer fake.nameMutex.Unlock() 263 fake.NameStub = nil 264 fake.nameReturns = struct { 265 result1 string 266 }{result1} 267 } 268 269 func (fake *OSFileInfo) NameReturnsOnCall(i int, result1 string) { 270 fake.nameMutex.Lock() 271 defer fake.nameMutex.Unlock() 272 fake.NameStub = nil 273 if fake.nameReturnsOnCall == nil { 274 fake.nameReturnsOnCall = make(map[int]struct { 275 result1 string 276 }) 277 } 278 fake.nameReturnsOnCall[i] = struct { 279 result1 string 280 }{result1} 281 } 282 283 func (fake *OSFileInfo) Size() int64 { 284 fake.sizeMutex.Lock() 285 ret, specificReturn := fake.sizeReturnsOnCall[len(fake.sizeArgsForCall)] 286 fake.sizeArgsForCall = append(fake.sizeArgsForCall, struct { 287 }{}) 288 fake.recordInvocation("Size", []interface{}{}) 289 fake.sizeMutex.Unlock() 290 if fake.SizeStub != nil { 291 return fake.SizeStub() 292 } 293 if specificReturn { 294 return ret.result1 295 } 296 fakeReturns := fake.sizeReturns 297 return fakeReturns.result1 298 } 299 300 func (fake *OSFileInfo) SizeCallCount() int { 301 fake.sizeMutex.RLock() 302 defer fake.sizeMutex.RUnlock() 303 return len(fake.sizeArgsForCall) 304 } 305 306 func (fake *OSFileInfo) SizeCalls(stub func() int64) { 307 fake.sizeMutex.Lock() 308 defer fake.sizeMutex.Unlock() 309 fake.SizeStub = stub 310 } 311 312 func (fake *OSFileInfo) SizeReturns(result1 int64) { 313 fake.sizeMutex.Lock() 314 defer fake.sizeMutex.Unlock() 315 fake.SizeStub = nil 316 fake.sizeReturns = struct { 317 result1 int64 318 }{result1} 319 } 320 321 func (fake *OSFileInfo) SizeReturnsOnCall(i int, result1 int64) { 322 fake.sizeMutex.Lock() 323 defer fake.sizeMutex.Unlock() 324 fake.SizeStub = nil 325 if fake.sizeReturnsOnCall == nil { 326 fake.sizeReturnsOnCall = make(map[int]struct { 327 result1 int64 328 }) 329 } 330 fake.sizeReturnsOnCall[i] = struct { 331 result1 int64 332 }{result1} 333 } 334 335 func (fake *OSFileInfo) Sys() interface{} { 336 fake.sysMutex.Lock() 337 ret, specificReturn := fake.sysReturnsOnCall[len(fake.sysArgsForCall)] 338 fake.sysArgsForCall = append(fake.sysArgsForCall, struct { 339 }{}) 340 fake.recordInvocation("Sys", []interface{}{}) 341 fake.sysMutex.Unlock() 342 if fake.SysStub != nil { 343 return fake.SysStub() 344 } 345 if specificReturn { 346 return ret.result1 347 } 348 fakeReturns := fake.sysReturns 349 return fakeReturns.result1 350 } 351 352 func (fake *OSFileInfo) SysCallCount() int { 353 fake.sysMutex.RLock() 354 defer fake.sysMutex.RUnlock() 355 return len(fake.sysArgsForCall) 356 } 357 358 func (fake *OSFileInfo) SysCalls(stub func() interface{}) { 359 fake.sysMutex.Lock() 360 defer fake.sysMutex.Unlock() 361 fake.SysStub = stub 362 } 363 364 func (fake *OSFileInfo) SysReturns(result1 interface{}) { 365 fake.sysMutex.Lock() 366 defer fake.sysMutex.Unlock() 367 fake.SysStub = nil 368 fake.sysReturns = struct { 369 result1 interface{} 370 }{result1} 371 } 372 373 func (fake *OSFileInfo) SysReturnsOnCall(i int, result1 interface{}) { 374 fake.sysMutex.Lock() 375 defer fake.sysMutex.Unlock() 376 fake.SysStub = nil 377 if fake.sysReturnsOnCall == nil { 378 fake.sysReturnsOnCall = make(map[int]struct { 379 result1 interface{} 380 }) 381 } 382 fake.sysReturnsOnCall[i] = struct { 383 result1 interface{} 384 }{result1} 385 } 386 387 func (fake *OSFileInfo) Invocations() map[string][][]interface{} { 388 fake.invocationsMutex.RLock() 389 defer fake.invocationsMutex.RUnlock() 390 fake.isDirMutex.RLock() 391 defer fake.isDirMutex.RUnlock() 392 fake.modTimeMutex.RLock() 393 defer fake.modTimeMutex.RUnlock() 394 fake.modeMutex.RLock() 395 defer fake.modeMutex.RUnlock() 396 fake.nameMutex.RLock() 397 defer fake.nameMutex.RUnlock() 398 fake.sizeMutex.RLock() 399 defer fake.sizeMutex.RUnlock() 400 fake.sysMutex.RLock() 401 defer fake.sysMutex.RUnlock() 402 copiedInvocations := map[string][][]interface{}{} 403 for key, value := range fake.invocations { 404 copiedInvocations[key] = value 405 } 406 return copiedInvocations 407 } 408 409 func (fake *OSFileInfo) recordInvocation(key string, args []interface{}) { 410 fake.invocationsMutex.Lock() 411 defer fake.invocationsMutex.Unlock() 412 if fake.invocations == nil { 413 fake.invocations = map[string][][]interface{}{} 414 } 415 if fake.invocations[key] == nil { 416 fake.invocations[key] = [][]interface{}{} 417 } 418 fake.invocations[key] = append(fake.invocations[key], args) 419 }