github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/api/plugin/pluginfakes/fake_proxy_reader.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package pluginfakes 3 4 import ( 5 "io" 6 "sync" 7 8 "code.cloudfoundry.org/cli/api/plugin" 9 ) 10 11 type FakeProxyReader struct { 12 FinishStub func() 13 finishMutex sync.RWMutex 14 finishArgsForCall []struct { 15 } 16 StartStub func(int64) 17 startMutex sync.RWMutex 18 startArgsForCall []struct { 19 arg1 int64 20 } 21 WrapStub func(io.Reader) io.ReadCloser 22 wrapMutex sync.RWMutex 23 wrapArgsForCall []struct { 24 arg1 io.Reader 25 } 26 wrapReturns struct { 27 result1 io.ReadCloser 28 } 29 wrapReturnsOnCall map[int]struct { 30 result1 io.ReadCloser 31 } 32 invocations map[string][][]interface{} 33 invocationsMutex sync.RWMutex 34 } 35 36 func (fake *FakeProxyReader) Finish() { 37 fake.finishMutex.Lock() 38 fake.finishArgsForCall = append(fake.finishArgsForCall, struct { 39 }{}) 40 fake.recordInvocation("Finish", []interface{}{}) 41 fake.finishMutex.Unlock() 42 if fake.FinishStub != nil { 43 fake.FinishStub() 44 } 45 } 46 47 func (fake *FakeProxyReader) FinishCallCount() int { 48 fake.finishMutex.RLock() 49 defer fake.finishMutex.RUnlock() 50 return len(fake.finishArgsForCall) 51 } 52 53 func (fake *FakeProxyReader) FinishCalls(stub func()) { 54 fake.finishMutex.Lock() 55 defer fake.finishMutex.Unlock() 56 fake.FinishStub = stub 57 } 58 59 func (fake *FakeProxyReader) Start(arg1 int64) { 60 fake.startMutex.Lock() 61 fake.startArgsForCall = append(fake.startArgsForCall, struct { 62 arg1 int64 63 }{arg1}) 64 fake.recordInvocation("Start", []interface{}{arg1}) 65 fake.startMutex.Unlock() 66 if fake.StartStub != nil { 67 fake.StartStub(arg1) 68 } 69 } 70 71 func (fake *FakeProxyReader) StartCallCount() int { 72 fake.startMutex.RLock() 73 defer fake.startMutex.RUnlock() 74 return len(fake.startArgsForCall) 75 } 76 77 func (fake *FakeProxyReader) StartCalls(stub func(int64)) { 78 fake.startMutex.Lock() 79 defer fake.startMutex.Unlock() 80 fake.StartStub = stub 81 } 82 83 func (fake *FakeProxyReader) StartArgsForCall(i int) int64 { 84 fake.startMutex.RLock() 85 defer fake.startMutex.RUnlock() 86 argsForCall := fake.startArgsForCall[i] 87 return argsForCall.arg1 88 } 89 90 func (fake *FakeProxyReader) Wrap(arg1 io.Reader) io.ReadCloser { 91 fake.wrapMutex.Lock() 92 ret, specificReturn := fake.wrapReturnsOnCall[len(fake.wrapArgsForCall)] 93 fake.wrapArgsForCall = append(fake.wrapArgsForCall, struct { 94 arg1 io.Reader 95 }{arg1}) 96 fake.recordInvocation("Wrap", []interface{}{arg1}) 97 fake.wrapMutex.Unlock() 98 if fake.WrapStub != nil { 99 return fake.WrapStub(arg1) 100 } 101 if specificReturn { 102 return ret.result1 103 } 104 fakeReturns := fake.wrapReturns 105 return fakeReturns.result1 106 } 107 108 func (fake *FakeProxyReader) WrapCallCount() int { 109 fake.wrapMutex.RLock() 110 defer fake.wrapMutex.RUnlock() 111 return len(fake.wrapArgsForCall) 112 } 113 114 func (fake *FakeProxyReader) WrapCalls(stub func(io.Reader) io.ReadCloser) { 115 fake.wrapMutex.Lock() 116 defer fake.wrapMutex.Unlock() 117 fake.WrapStub = stub 118 } 119 120 func (fake *FakeProxyReader) WrapArgsForCall(i int) io.Reader { 121 fake.wrapMutex.RLock() 122 defer fake.wrapMutex.RUnlock() 123 argsForCall := fake.wrapArgsForCall[i] 124 return argsForCall.arg1 125 } 126 127 func (fake *FakeProxyReader) WrapReturns(result1 io.ReadCloser) { 128 fake.wrapMutex.Lock() 129 defer fake.wrapMutex.Unlock() 130 fake.WrapStub = nil 131 fake.wrapReturns = struct { 132 result1 io.ReadCloser 133 }{result1} 134 } 135 136 func (fake *FakeProxyReader) WrapReturnsOnCall(i int, result1 io.ReadCloser) { 137 fake.wrapMutex.Lock() 138 defer fake.wrapMutex.Unlock() 139 fake.WrapStub = nil 140 if fake.wrapReturnsOnCall == nil { 141 fake.wrapReturnsOnCall = make(map[int]struct { 142 result1 io.ReadCloser 143 }) 144 } 145 fake.wrapReturnsOnCall[i] = struct { 146 result1 io.ReadCloser 147 }{result1} 148 } 149 150 func (fake *FakeProxyReader) Invocations() map[string][][]interface{} { 151 fake.invocationsMutex.RLock() 152 defer fake.invocationsMutex.RUnlock() 153 fake.finishMutex.RLock() 154 defer fake.finishMutex.RUnlock() 155 fake.startMutex.RLock() 156 defer fake.startMutex.RUnlock() 157 fake.wrapMutex.RLock() 158 defer fake.wrapMutex.RUnlock() 159 copiedInvocations := map[string][][]interface{}{} 160 for key, value := range fake.invocations { 161 copiedInvocations[key] = value 162 } 163 return copiedInvocations 164 } 165 166 func (fake *FakeProxyReader) recordInvocation(key string, args []interface{}) { 167 fake.invocationsMutex.Lock() 168 defer fake.invocationsMutex.Unlock() 169 if fake.invocations == nil { 170 fake.invocations = map[string][][]interface{}{} 171 } 172 if fake.invocations[key] == nil { 173 fake.invocations[key] = [][]interface{}{} 174 } 175 fake.invocations[key] = append(fake.invocations[key], args) 176 } 177 178 var _ plugin.ProxyReader = new(FakeProxyReader)