github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/actor/v2action/v2actionfakes/fake_noaaclient.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v2actionfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/v2action" 8 "github.com/cloudfoundry/sonde-go/events" 9 ) 10 11 type FakeNOAAClient struct { 12 CloseStub func() error 13 closeMutex sync.RWMutex 14 closeArgsForCall []struct { 15 } 16 closeReturns struct { 17 result1 error 18 } 19 closeReturnsOnCall map[int]struct { 20 result1 error 21 } 22 RecentLogsStub func(string, string) ([]*events.LogMessage, error) 23 recentLogsMutex sync.RWMutex 24 recentLogsArgsForCall []struct { 25 arg1 string 26 arg2 string 27 } 28 recentLogsReturns struct { 29 result1 []*events.LogMessage 30 result2 error 31 } 32 recentLogsReturnsOnCall map[int]struct { 33 result1 []*events.LogMessage 34 result2 error 35 } 36 SetOnConnectCallbackStub func(func()) 37 setOnConnectCallbackMutex sync.RWMutex 38 setOnConnectCallbackArgsForCall []struct { 39 arg1 func() 40 } 41 TailingLogsStub func(string, string) (<-chan *events.LogMessage, <-chan error) 42 tailingLogsMutex sync.RWMutex 43 tailingLogsArgsForCall []struct { 44 arg1 string 45 arg2 string 46 } 47 tailingLogsReturns struct { 48 result1 <-chan *events.LogMessage 49 result2 <-chan error 50 } 51 tailingLogsReturnsOnCall map[int]struct { 52 result1 <-chan *events.LogMessage 53 result2 <-chan error 54 } 55 invocations map[string][][]interface{} 56 invocationsMutex sync.RWMutex 57 } 58 59 func (fake *FakeNOAAClient) Close() error { 60 fake.closeMutex.Lock() 61 ret, specificReturn := fake.closeReturnsOnCall[len(fake.closeArgsForCall)] 62 fake.closeArgsForCall = append(fake.closeArgsForCall, struct { 63 }{}) 64 fake.recordInvocation("Close", []interface{}{}) 65 fake.closeMutex.Unlock() 66 if fake.CloseStub != nil { 67 return fake.CloseStub() 68 } 69 if specificReturn { 70 return ret.result1 71 } 72 fakeReturns := fake.closeReturns 73 return fakeReturns.result1 74 } 75 76 func (fake *FakeNOAAClient) CloseCallCount() int { 77 fake.closeMutex.RLock() 78 defer fake.closeMutex.RUnlock() 79 return len(fake.closeArgsForCall) 80 } 81 82 func (fake *FakeNOAAClient) CloseCalls(stub func() error) { 83 fake.closeMutex.Lock() 84 defer fake.closeMutex.Unlock() 85 fake.CloseStub = stub 86 } 87 88 func (fake *FakeNOAAClient) CloseReturns(result1 error) { 89 fake.closeMutex.Lock() 90 defer fake.closeMutex.Unlock() 91 fake.CloseStub = nil 92 fake.closeReturns = struct { 93 result1 error 94 }{result1} 95 } 96 97 func (fake *FakeNOAAClient) CloseReturnsOnCall(i int, result1 error) { 98 fake.closeMutex.Lock() 99 defer fake.closeMutex.Unlock() 100 fake.CloseStub = nil 101 if fake.closeReturnsOnCall == nil { 102 fake.closeReturnsOnCall = make(map[int]struct { 103 result1 error 104 }) 105 } 106 fake.closeReturnsOnCall[i] = struct { 107 result1 error 108 }{result1} 109 } 110 111 func (fake *FakeNOAAClient) RecentLogs(arg1 string, arg2 string) ([]*events.LogMessage, error) { 112 fake.recentLogsMutex.Lock() 113 ret, specificReturn := fake.recentLogsReturnsOnCall[len(fake.recentLogsArgsForCall)] 114 fake.recentLogsArgsForCall = append(fake.recentLogsArgsForCall, struct { 115 arg1 string 116 arg2 string 117 }{arg1, arg2}) 118 fake.recordInvocation("RecentLogs", []interface{}{arg1, arg2}) 119 fake.recentLogsMutex.Unlock() 120 if fake.RecentLogsStub != nil { 121 return fake.RecentLogsStub(arg1, arg2) 122 } 123 if specificReturn { 124 return ret.result1, ret.result2 125 } 126 fakeReturns := fake.recentLogsReturns 127 return fakeReturns.result1, fakeReturns.result2 128 } 129 130 func (fake *FakeNOAAClient) RecentLogsCallCount() int { 131 fake.recentLogsMutex.RLock() 132 defer fake.recentLogsMutex.RUnlock() 133 return len(fake.recentLogsArgsForCall) 134 } 135 136 func (fake *FakeNOAAClient) RecentLogsCalls(stub func(string, string) ([]*events.LogMessage, error)) { 137 fake.recentLogsMutex.Lock() 138 defer fake.recentLogsMutex.Unlock() 139 fake.RecentLogsStub = stub 140 } 141 142 func (fake *FakeNOAAClient) RecentLogsArgsForCall(i int) (string, string) { 143 fake.recentLogsMutex.RLock() 144 defer fake.recentLogsMutex.RUnlock() 145 argsForCall := fake.recentLogsArgsForCall[i] 146 return argsForCall.arg1, argsForCall.arg2 147 } 148 149 func (fake *FakeNOAAClient) RecentLogsReturns(result1 []*events.LogMessage, result2 error) { 150 fake.recentLogsMutex.Lock() 151 defer fake.recentLogsMutex.Unlock() 152 fake.RecentLogsStub = nil 153 fake.recentLogsReturns = struct { 154 result1 []*events.LogMessage 155 result2 error 156 }{result1, result2} 157 } 158 159 func (fake *FakeNOAAClient) RecentLogsReturnsOnCall(i int, result1 []*events.LogMessage, result2 error) { 160 fake.recentLogsMutex.Lock() 161 defer fake.recentLogsMutex.Unlock() 162 fake.RecentLogsStub = nil 163 if fake.recentLogsReturnsOnCall == nil { 164 fake.recentLogsReturnsOnCall = make(map[int]struct { 165 result1 []*events.LogMessage 166 result2 error 167 }) 168 } 169 fake.recentLogsReturnsOnCall[i] = struct { 170 result1 []*events.LogMessage 171 result2 error 172 }{result1, result2} 173 } 174 175 func (fake *FakeNOAAClient) SetOnConnectCallback(arg1 func()) { 176 fake.setOnConnectCallbackMutex.Lock() 177 fake.setOnConnectCallbackArgsForCall = append(fake.setOnConnectCallbackArgsForCall, struct { 178 arg1 func() 179 }{arg1}) 180 fake.recordInvocation("SetOnConnectCallback", []interface{}{arg1}) 181 fake.setOnConnectCallbackMutex.Unlock() 182 if fake.SetOnConnectCallbackStub != nil { 183 fake.SetOnConnectCallbackStub(arg1) 184 } 185 } 186 187 func (fake *FakeNOAAClient) SetOnConnectCallbackCallCount() int { 188 fake.setOnConnectCallbackMutex.RLock() 189 defer fake.setOnConnectCallbackMutex.RUnlock() 190 return len(fake.setOnConnectCallbackArgsForCall) 191 } 192 193 func (fake *FakeNOAAClient) SetOnConnectCallbackCalls(stub func(func())) { 194 fake.setOnConnectCallbackMutex.Lock() 195 defer fake.setOnConnectCallbackMutex.Unlock() 196 fake.SetOnConnectCallbackStub = stub 197 } 198 199 func (fake *FakeNOAAClient) SetOnConnectCallbackArgsForCall(i int) func() { 200 fake.setOnConnectCallbackMutex.RLock() 201 defer fake.setOnConnectCallbackMutex.RUnlock() 202 argsForCall := fake.setOnConnectCallbackArgsForCall[i] 203 return argsForCall.arg1 204 } 205 206 func (fake *FakeNOAAClient) TailingLogs(arg1 string, arg2 string) (<-chan *events.LogMessage, <-chan error) { 207 fake.tailingLogsMutex.Lock() 208 ret, specificReturn := fake.tailingLogsReturnsOnCall[len(fake.tailingLogsArgsForCall)] 209 fake.tailingLogsArgsForCall = append(fake.tailingLogsArgsForCall, struct { 210 arg1 string 211 arg2 string 212 }{arg1, arg2}) 213 fake.recordInvocation("TailingLogs", []interface{}{arg1, arg2}) 214 fake.tailingLogsMutex.Unlock() 215 if fake.TailingLogsStub != nil { 216 return fake.TailingLogsStub(arg1, arg2) 217 } 218 if specificReturn { 219 return ret.result1, ret.result2 220 } 221 fakeReturns := fake.tailingLogsReturns 222 return fakeReturns.result1, fakeReturns.result2 223 } 224 225 func (fake *FakeNOAAClient) TailingLogsCallCount() int { 226 fake.tailingLogsMutex.RLock() 227 defer fake.tailingLogsMutex.RUnlock() 228 return len(fake.tailingLogsArgsForCall) 229 } 230 231 func (fake *FakeNOAAClient) TailingLogsCalls(stub func(string, string) (<-chan *events.LogMessage, <-chan error)) { 232 fake.tailingLogsMutex.Lock() 233 defer fake.tailingLogsMutex.Unlock() 234 fake.TailingLogsStub = stub 235 } 236 237 func (fake *FakeNOAAClient) TailingLogsArgsForCall(i int) (string, string) { 238 fake.tailingLogsMutex.RLock() 239 defer fake.tailingLogsMutex.RUnlock() 240 argsForCall := fake.tailingLogsArgsForCall[i] 241 return argsForCall.arg1, argsForCall.arg2 242 } 243 244 func (fake *FakeNOAAClient) TailingLogsReturns(result1 <-chan *events.LogMessage, result2 <-chan error) { 245 fake.tailingLogsMutex.Lock() 246 defer fake.tailingLogsMutex.Unlock() 247 fake.TailingLogsStub = nil 248 fake.tailingLogsReturns = struct { 249 result1 <-chan *events.LogMessage 250 result2 <-chan error 251 }{result1, result2} 252 } 253 254 func (fake *FakeNOAAClient) TailingLogsReturnsOnCall(i int, result1 <-chan *events.LogMessage, result2 <-chan error) { 255 fake.tailingLogsMutex.Lock() 256 defer fake.tailingLogsMutex.Unlock() 257 fake.TailingLogsStub = nil 258 if fake.tailingLogsReturnsOnCall == nil { 259 fake.tailingLogsReturnsOnCall = make(map[int]struct { 260 result1 <-chan *events.LogMessage 261 result2 <-chan error 262 }) 263 } 264 fake.tailingLogsReturnsOnCall[i] = struct { 265 result1 <-chan *events.LogMessage 266 result2 <-chan error 267 }{result1, result2} 268 } 269 270 func (fake *FakeNOAAClient) Invocations() map[string][][]interface{} { 271 fake.invocationsMutex.RLock() 272 defer fake.invocationsMutex.RUnlock() 273 fake.closeMutex.RLock() 274 defer fake.closeMutex.RUnlock() 275 fake.recentLogsMutex.RLock() 276 defer fake.recentLogsMutex.RUnlock() 277 fake.setOnConnectCallbackMutex.RLock() 278 defer fake.setOnConnectCallbackMutex.RUnlock() 279 fake.tailingLogsMutex.RLock() 280 defer fake.tailingLogsMutex.RUnlock() 281 copiedInvocations := map[string][][]interface{}{} 282 for key, value := range fake.invocations { 283 copiedInvocations[key] = value 284 } 285 return copiedInvocations 286 } 287 288 func (fake *FakeNOAAClient) recordInvocation(key string, args []interface{}) { 289 fake.invocationsMutex.Lock() 290 defer fake.invocationsMutex.Unlock() 291 if fake.invocations == nil { 292 fake.invocations = map[string][][]interface{}{} 293 } 294 if fake.invocations[key] == nil { 295 fake.invocations[key] = [][]interface{}{} 296 } 297 fake.invocations[key] = append(fake.invocations[key], args) 298 } 299 300 var _ v2action.NOAAClient = new(FakeNOAAClient)