github.com/swisscom/cloudfoundry-cli@v7.1.0+incompatible/cf/api/logs/logsfakes/fake_loggable.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package logsfakes 3 4 import ( 5 "sync" 6 "time" 7 8 "code.cloudfoundry.org/cli/cf/api/logs" 9 ) 10 11 type FakeLoggable struct { 12 GetSourceNameStub func() string 13 getSourceNameMutex sync.RWMutex 14 getSourceNameArgsForCall []struct { 15 } 16 getSourceNameReturns struct { 17 result1 string 18 } 19 getSourceNameReturnsOnCall map[int]struct { 20 result1 string 21 } 22 ToLogStub func(*time.Location) string 23 toLogMutex sync.RWMutex 24 toLogArgsForCall []struct { 25 arg1 *time.Location 26 } 27 toLogReturns struct { 28 result1 string 29 } 30 toLogReturnsOnCall map[int]struct { 31 result1 string 32 } 33 ToSimpleLogStub func() string 34 toSimpleLogMutex sync.RWMutex 35 toSimpleLogArgsForCall []struct { 36 } 37 toSimpleLogReturns struct { 38 result1 string 39 } 40 toSimpleLogReturnsOnCall map[int]struct { 41 result1 string 42 } 43 invocations map[string][][]interface{} 44 invocationsMutex sync.RWMutex 45 } 46 47 func (fake *FakeLoggable) GetSourceName() string { 48 fake.getSourceNameMutex.Lock() 49 ret, specificReturn := fake.getSourceNameReturnsOnCall[len(fake.getSourceNameArgsForCall)] 50 fake.getSourceNameArgsForCall = append(fake.getSourceNameArgsForCall, struct { 51 }{}) 52 fake.recordInvocation("GetSourceName", []interface{}{}) 53 fake.getSourceNameMutex.Unlock() 54 if fake.GetSourceNameStub != nil { 55 return fake.GetSourceNameStub() 56 } 57 if specificReturn { 58 return ret.result1 59 } 60 fakeReturns := fake.getSourceNameReturns 61 return fakeReturns.result1 62 } 63 64 func (fake *FakeLoggable) GetSourceNameCallCount() int { 65 fake.getSourceNameMutex.RLock() 66 defer fake.getSourceNameMutex.RUnlock() 67 return len(fake.getSourceNameArgsForCall) 68 } 69 70 func (fake *FakeLoggable) GetSourceNameCalls(stub func() string) { 71 fake.getSourceNameMutex.Lock() 72 defer fake.getSourceNameMutex.Unlock() 73 fake.GetSourceNameStub = stub 74 } 75 76 func (fake *FakeLoggable) GetSourceNameReturns(result1 string) { 77 fake.getSourceNameMutex.Lock() 78 defer fake.getSourceNameMutex.Unlock() 79 fake.GetSourceNameStub = nil 80 fake.getSourceNameReturns = struct { 81 result1 string 82 }{result1} 83 } 84 85 func (fake *FakeLoggable) GetSourceNameReturnsOnCall(i int, result1 string) { 86 fake.getSourceNameMutex.Lock() 87 defer fake.getSourceNameMutex.Unlock() 88 fake.GetSourceNameStub = nil 89 if fake.getSourceNameReturnsOnCall == nil { 90 fake.getSourceNameReturnsOnCall = make(map[int]struct { 91 result1 string 92 }) 93 } 94 fake.getSourceNameReturnsOnCall[i] = struct { 95 result1 string 96 }{result1} 97 } 98 99 func (fake *FakeLoggable) ToLog(arg1 *time.Location) string { 100 fake.toLogMutex.Lock() 101 ret, specificReturn := fake.toLogReturnsOnCall[len(fake.toLogArgsForCall)] 102 fake.toLogArgsForCall = append(fake.toLogArgsForCall, struct { 103 arg1 *time.Location 104 }{arg1}) 105 fake.recordInvocation("ToLog", []interface{}{arg1}) 106 fake.toLogMutex.Unlock() 107 if fake.ToLogStub != nil { 108 return fake.ToLogStub(arg1) 109 } 110 if specificReturn { 111 return ret.result1 112 } 113 fakeReturns := fake.toLogReturns 114 return fakeReturns.result1 115 } 116 117 func (fake *FakeLoggable) ToLogCallCount() int { 118 fake.toLogMutex.RLock() 119 defer fake.toLogMutex.RUnlock() 120 return len(fake.toLogArgsForCall) 121 } 122 123 func (fake *FakeLoggable) ToLogCalls(stub func(*time.Location) string) { 124 fake.toLogMutex.Lock() 125 defer fake.toLogMutex.Unlock() 126 fake.ToLogStub = stub 127 } 128 129 func (fake *FakeLoggable) ToLogArgsForCall(i int) *time.Location { 130 fake.toLogMutex.RLock() 131 defer fake.toLogMutex.RUnlock() 132 argsForCall := fake.toLogArgsForCall[i] 133 return argsForCall.arg1 134 } 135 136 func (fake *FakeLoggable) ToLogReturns(result1 string) { 137 fake.toLogMutex.Lock() 138 defer fake.toLogMutex.Unlock() 139 fake.ToLogStub = nil 140 fake.toLogReturns = struct { 141 result1 string 142 }{result1} 143 } 144 145 func (fake *FakeLoggable) ToLogReturnsOnCall(i int, result1 string) { 146 fake.toLogMutex.Lock() 147 defer fake.toLogMutex.Unlock() 148 fake.ToLogStub = nil 149 if fake.toLogReturnsOnCall == nil { 150 fake.toLogReturnsOnCall = make(map[int]struct { 151 result1 string 152 }) 153 } 154 fake.toLogReturnsOnCall[i] = struct { 155 result1 string 156 }{result1} 157 } 158 159 func (fake *FakeLoggable) ToSimpleLog() string { 160 fake.toSimpleLogMutex.Lock() 161 ret, specificReturn := fake.toSimpleLogReturnsOnCall[len(fake.toSimpleLogArgsForCall)] 162 fake.toSimpleLogArgsForCall = append(fake.toSimpleLogArgsForCall, struct { 163 }{}) 164 fake.recordInvocation("ToSimpleLog", []interface{}{}) 165 fake.toSimpleLogMutex.Unlock() 166 if fake.ToSimpleLogStub != nil { 167 return fake.ToSimpleLogStub() 168 } 169 if specificReturn { 170 return ret.result1 171 } 172 fakeReturns := fake.toSimpleLogReturns 173 return fakeReturns.result1 174 } 175 176 func (fake *FakeLoggable) ToSimpleLogCallCount() int { 177 fake.toSimpleLogMutex.RLock() 178 defer fake.toSimpleLogMutex.RUnlock() 179 return len(fake.toSimpleLogArgsForCall) 180 } 181 182 func (fake *FakeLoggable) ToSimpleLogCalls(stub func() string) { 183 fake.toSimpleLogMutex.Lock() 184 defer fake.toSimpleLogMutex.Unlock() 185 fake.ToSimpleLogStub = stub 186 } 187 188 func (fake *FakeLoggable) ToSimpleLogReturns(result1 string) { 189 fake.toSimpleLogMutex.Lock() 190 defer fake.toSimpleLogMutex.Unlock() 191 fake.ToSimpleLogStub = nil 192 fake.toSimpleLogReturns = struct { 193 result1 string 194 }{result1} 195 } 196 197 func (fake *FakeLoggable) ToSimpleLogReturnsOnCall(i int, result1 string) { 198 fake.toSimpleLogMutex.Lock() 199 defer fake.toSimpleLogMutex.Unlock() 200 fake.ToSimpleLogStub = nil 201 if fake.toSimpleLogReturnsOnCall == nil { 202 fake.toSimpleLogReturnsOnCall = make(map[int]struct { 203 result1 string 204 }) 205 } 206 fake.toSimpleLogReturnsOnCall[i] = struct { 207 result1 string 208 }{result1} 209 } 210 211 func (fake *FakeLoggable) Invocations() map[string][][]interface{} { 212 fake.invocationsMutex.RLock() 213 defer fake.invocationsMutex.RUnlock() 214 fake.getSourceNameMutex.RLock() 215 defer fake.getSourceNameMutex.RUnlock() 216 fake.toLogMutex.RLock() 217 defer fake.toLogMutex.RUnlock() 218 fake.toSimpleLogMutex.RLock() 219 defer fake.toSimpleLogMutex.RUnlock() 220 copiedInvocations := map[string][][]interface{}{} 221 for key, value := range fake.invocations { 222 copiedInvocations[key] = value 223 } 224 return copiedInvocations 225 } 226 227 func (fake *FakeLoggable) recordInvocation(key string, args []interface{}) { 228 fake.invocationsMutex.Lock() 229 defer fake.invocationsMutex.Unlock() 230 if fake.invocations == nil { 231 fake.invocations = map[string][][]interface{}{} 232 } 233 if fake.invocations[key] == nil { 234 fake.invocations[key] = [][]interface{}{} 235 } 236 fake.invocations[key] = append(fake.invocations[key], args) 237 } 238 239 var _ logs.Loggable = new(FakeLoggable)