This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
route_mappings_repo.go
241 lines (218 loc) · 6.99 KB
/
route_mappings_repo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
// Code generated by counterfeiter. DO NOT EDIT.
package fakes
import (
"sync"
"code.cloudfoundry.org/copilot/models"
)
type RouteMappingsRepo struct {
GetCalculatedWeightStub func(rm *models.RouteMapping) int32
getCalculatedWeightMutex sync.RWMutex
getCalculatedWeightArgsForCall []struct {
rm *models.RouteMapping
}
getCalculatedWeightReturns struct {
result1 int32
}
getCalculatedWeightReturnsOnCall map[int]struct {
result1 int32
}
MapStub func(routeMapping *models.RouteMapping)
mapMutex sync.RWMutex
mapArgsForCall []struct {
routeMapping *models.RouteMapping
}
UnmapStub func(routeMapping *models.RouteMapping)
unmapMutex sync.RWMutex
unmapArgsForCall []struct {
routeMapping *models.RouteMapping
}
SyncStub func(routeMappings []*models.RouteMapping)
syncMutex sync.RWMutex
syncArgsForCall []struct {
routeMappings []*models.RouteMapping
}
ListStub func() map[string]*models.RouteMapping
listMutex sync.RWMutex
listArgsForCall []struct{}
listReturns struct {
result1 map[string]*models.RouteMapping
}
listReturnsOnCall map[int]struct {
result1 map[string]*models.RouteMapping
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *RouteMappingsRepo) GetCalculatedWeight(rm *models.RouteMapping) int32 {
fake.getCalculatedWeightMutex.Lock()
ret, specificReturn := fake.getCalculatedWeightReturnsOnCall[len(fake.getCalculatedWeightArgsForCall)]
fake.getCalculatedWeightArgsForCall = append(fake.getCalculatedWeightArgsForCall, struct {
rm *models.RouteMapping
}{rm})
fake.recordInvocation("GetCalculatedWeight", []interface{}{rm})
fake.getCalculatedWeightMutex.Unlock()
if fake.GetCalculatedWeightStub != nil {
return fake.GetCalculatedWeightStub(rm)
}
if specificReturn {
return ret.result1
}
return fake.getCalculatedWeightReturns.result1
}
func (fake *RouteMappingsRepo) GetCalculatedWeightCallCount() int {
fake.getCalculatedWeightMutex.RLock()
defer fake.getCalculatedWeightMutex.RUnlock()
return len(fake.getCalculatedWeightArgsForCall)
}
func (fake *RouteMappingsRepo) GetCalculatedWeightArgsForCall(i int) *models.RouteMapping {
fake.getCalculatedWeightMutex.RLock()
defer fake.getCalculatedWeightMutex.RUnlock()
return fake.getCalculatedWeightArgsForCall[i].rm
}
func (fake *RouteMappingsRepo) GetCalculatedWeightReturns(result1 int32) {
fake.GetCalculatedWeightStub = nil
fake.getCalculatedWeightReturns = struct {
result1 int32
}{result1}
}
func (fake *RouteMappingsRepo) GetCalculatedWeightReturnsOnCall(i int, result1 int32) {
fake.GetCalculatedWeightStub = nil
if fake.getCalculatedWeightReturnsOnCall == nil {
fake.getCalculatedWeightReturnsOnCall = make(map[int]struct {
result1 int32
})
}
fake.getCalculatedWeightReturnsOnCall[i] = struct {
result1 int32
}{result1}
}
func (fake *RouteMappingsRepo) Map(routeMapping *models.RouteMapping) {
fake.mapMutex.Lock()
fake.mapArgsForCall = append(fake.mapArgsForCall, struct {
routeMapping *models.RouteMapping
}{routeMapping})
fake.recordInvocation("Map", []interface{}{routeMapping})
fake.mapMutex.Unlock()
if fake.MapStub != nil {
fake.MapStub(routeMapping)
}
}
func (fake *RouteMappingsRepo) MapCallCount() int {
fake.mapMutex.RLock()
defer fake.mapMutex.RUnlock()
return len(fake.mapArgsForCall)
}
func (fake *RouteMappingsRepo) MapArgsForCall(i int) *models.RouteMapping {
fake.mapMutex.RLock()
defer fake.mapMutex.RUnlock()
return fake.mapArgsForCall[i].routeMapping
}
func (fake *RouteMappingsRepo) Unmap(routeMapping *models.RouteMapping) {
fake.unmapMutex.Lock()
fake.unmapArgsForCall = append(fake.unmapArgsForCall, struct {
routeMapping *models.RouteMapping
}{routeMapping})
fake.recordInvocation("Unmap", []interface{}{routeMapping})
fake.unmapMutex.Unlock()
if fake.UnmapStub != nil {
fake.UnmapStub(routeMapping)
}
}
func (fake *RouteMappingsRepo) UnmapCallCount() int {
fake.unmapMutex.RLock()
defer fake.unmapMutex.RUnlock()
return len(fake.unmapArgsForCall)
}
func (fake *RouteMappingsRepo) UnmapArgsForCall(i int) *models.RouteMapping {
fake.unmapMutex.RLock()
defer fake.unmapMutex.RUnlock()
return fake.unmapArgsForCall[i].routeMapping
}
func (fake *RouteMappingsRepo) Sync(routeMappings []*models.RouteMapping) {
var routeMappingsCopy []*models.RouteMapping
if routeMappings != nil {
routeMappingsCopy = make([]*models.RouteMapping, len(routeMappings))
copy(routeMappingsCopy, routeMappings)
}
fake.syncMutex.Lock()
fake.syncArgsForCall = append(fake.syncArgsForCall, struct {
routeMappings []*models.RouteMapping
}{routeMappingsCopy})
fake.recordInvocation("Sync", []interface{}{routeMappingsCopy})
fake.syncMutex.Unlock()
if fake.SyncStub != nil {
fake.SyncStub(routeMappings)
}
}
func (fake *RouteMappingsRepo) SyncCallCount() int {
fake.syncMutex.RLock()
defer fake.syncMutex.RUnlock()
return len(fake.syncArgsForCall)
}
func (fake *RouteMappingsRepo) SyncArgsForCall(i int) []*models.RouteMapping {
fake.syncMutex.RLock()
defer fake.syncMutex.RUnlock()
return fake.syncArgsForCall[i].routeMappings
}
func (fake *RouteMappingsRepo) List() map[string]*models.RouteMapping {
fake.listMutex.Lock()
ret, specificReturn := fake.listReturnsOnCall[len(fake.listArgsForCall)]
fake.listArgsForCall = append(fake.listArgsForCall, struct{}{})
fake.recordInvocation("List", []interface{}{})
fake.listMutex.Unlock()
if fake.ListStub != nil {
return fake.ListStub()
}
if specificReturn {
return ret.result1
}
return fake.listReturns.result1
}
func (fake *RouteMappingsRepo) ListCallCount() int {
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
return len(fake.listArgsForCall)
}
func (fake *RouteMappingsRepo) ListReturns(result1 map[string]*models.RouteMapping) {
fake.ListStub = nil
fake.listReturns = struct {
result1 map[string]*models.RouteMapping
}{result1}
}
func (fake *RouteMappingsRepo) ListReturnsOnCall(i int, result1 map[string]*models.RouteMapping) {
fake.ListStub = nil
if fake.listReturnsOnCall == nil {
fake.listReturnsOnCall = make(map[int]struct {
result1 map[string]*models.RouteMapping
})
}
fake.listReturnsOnCall[i] = struct {
result1 map[string]*models.RouteMapping
}{result1}
}
func (fake *RouteMappingsRepo) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.getCalculatedWeightMutex.RLock()
defer fake.getCalculatedWeightMutex.RUnlock()
fake.mapMutex.RLock()
defer fake.mapMutex.RUnlock()
fake.unmapMutex.RLock()
defer fake.unmapMutex.RUnlock()
fake.syncMutex.RLock()
defer fake.syncMutex.RUnlock()
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
return fake.invocations
}
func (fake *RouteMappingsRepo) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}