github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/worker/runtime/runtimefakes/fake_user_namespace.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package runtimefakes 3 4 import ( 5 "sync" 6 7 "github.com/pf-qiu/concourse/v6/worker/runtime" 8 ) 9 10 type FakeUserNamespace struct { 11 MaxValidIdsStub func() (uint32, uint32, error) 12 maxValidIdsMutex sync.RWMutex 13 maxValidIdsArgsForCall []struct { 14 } 15 maxValidIdsReturns struct { 16 result1 uint32 17 result2 uint32 18 result3 error 19 } 20 maxValidIdsReturnsOnCall map[int]struct { 21 result1 uint32 22 result2 uint32 23 result3 error 24 } 25 invocations map[string][][]interface{} 26 invocationsMutex sync.RWMutex 27 } 28 29 func (fake *FakeUserNamespace) MaxValidIds() (uint32, uint32, error) { 30 fake.maxValidIdsMutex.Lock() 31 ret, specificReturn := fake.maxValidIdsReturnsOnCall[len(fake.maxValidIdsArgsForCall)] 32 fake.maxValidIdsArgsForCall = append(fake.maxValidIdsArgsForCall, struct { 33 }{}) 34 fake.recordInvocation("MaxValidIds", []interface{}{}) 35 fake.maxValidIdsMutex.Unlock() 36 if fake.MaxValidIdsStub != nil { 37 return fake.MaxValidIdsStub() 38 } 39 if specificReturn { 40 return ret.result1, ret.result2, ret.result3 41 } 42 fakeReturns := fake.maxValidIdsReturns 43 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 44 } 45 46 func (fake *FakeUserNamespace) MaxValidIdsCallCount() int { 47 fake.maxValidIdsMutex.RLock() 48 defer fake.maxValidIdsMutex.RUnlock() 49 return len(fake.maxValidIdsArgsForCall) 50 } 51 52 func (fake *FakeUserNamespace) MaxValidIdsCalls(stub func() (uint32, uint32, error)) { 53 fake.maxValidIdsMutex.Lock() 54 defer fake.maxValidIdsMutex.Unlock() 55 fake.MaxValidIdsStub = stub 56 } 57 58 func (fake *FakeUserNamespace) MaxValidIdsReturns(result1 uint32, result2 uint32, result3 error) { 59 fake.maxValidIdsMutex.Lock() 60 defer fake.maxValidIdsMutex.Unlock() 61 fake.MaxValidIdsStub = nil 62 fake.maxValidIdsReturns = struct { 63 result1 uint32 64 result2 uint32 65 result3 error 66 }{result1, result2, result3} 67 } 68 69 func (fake *FakeUserNamespace) MaxValidIdsReturnsOnCall(i int, result1 uint32, result2 uint32, result3 error) { 70 fake.maxValidIdsMutex.Lock() 71 defer fake.maxValidIdsMutex.Unlock() 72 fake.MaxValidIdsStub = nil 73 if fake.maxValidIdsReturnsOnCall == nil { 74 fake.maxValidIdsReturnsOnCall = make(map[int]struct { 75 result1 uint32 76 result2 uint32 77 result3 error 78 }) 79 } 80 fake.maxValidIdsReturnsOnCall[i] = struct { 81 result1 uint32 82 result2 uint32 83 result3 error 84 }{result1, result2, result3} 85 } 86 87 func (fake *FakeUserNamespace) Invocations() map[string][][]interface{} { 88 fake.invocationsMutex.RLock() 89 defer fake.invocationsMutex.RUnlock() 90 fake.maxValidIdsMutex.RLock() 91 defer fake.maxValidIdsMutex.RUnlock() 92 copiedInvocations := map[string][][]interface{}{} 93 for key, value := range fake.invocations { 94 copiedInvocations[key] = value 95 } 96 return copiedInvocations 97 } 98 99 func (fake *FakeUserNamespace) recordInvocation(key string, args []interface{}) { 100 fake.invocationsMutex.Lock() 101 defer fake.invocationsMutex.Unlock() 102 if fake.invocations == nil { 103 fake.invocations = map[string][][]interface{}{} 104 } 105 if fake.invocations[key] == nil { 106 fake.invocations[key] = [][]interface{}{} 107 } 108 fake.invocations[key] = append(fake.invocations[key], args) 109 } 110 111 var _ runtime.UserNamespace = new(FakeUserNamespace)