-
Notifications
You must be signed in to change notification settings - Fork 450
/
repo_client.go
302 lines (260 loc) · 10.5 KB
/
repo_client.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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
// Copyright 2021 Security Scorecard Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by MockGen. DO NOT EDIT.
// Source: clients/repo_client.go
// Package mockrepo is a generated GoMock package.
package mockrepo
import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
clients "github.com/ossf/scorecard/v4/clients"
)
// MockRepoClient is a mock of RepoClient interface.
type MockRepoClient struct {
ctrl *gomock.Controller
recorder *MockRepoClientMockRecorder
}
// MockRepoClientMockRecorder is the mock recorder for MockRepoClient.
type MockRepoClientMockRecorder struct {
mock *MockRepoClient
}
// NewMockRepoClient creates a new mock instance.
func NewMockRepoClient(ctrl *gomock.Controller) *MockRepoClient {
mock := &MockRepoClient{ctrl: ctrl}
mock.recorder = &MockRepoClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockRepoClient) EXPECT() *MockRepoClientMockRecorder {
return m.recorder
}
// Close mocks base method.
func (m *MockRepoClient) Close() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Close")
ret0, _ := ret[0].(error)
return ret0
}
// Close indicates an expected call of Close.
func (mr *MockRepoClientMockRecorder) Close() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockRepoClient)(nil).Close))
}
// GetDefaultBranch mocks base method.
func (m *MockRepoClient) GetDefaultBranch() (*clients.BranchRef, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetDefaultBranch")
ret0, _ := ret[0].(*clients.BranchRef)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetDefaultBranch indicates an expected call of GetDefaultBranch.
func (mr *MockRepoClientMockRecorder) GetDefaultBranch() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultBranch", reflect.TypeOf((*MockRepoClient)(nil).GetDefaultBranch))
}
// GetFileContent mocks base method.
func (m *MockRepoClient) GetFileContent(filename string) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetFileContent", filename)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetFileContent indicates an expected call of GetFileContent.
func (mr *MockRepoClientMockRecorder) GetFileContent(filename interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFileContent", reflect.TypeOf((*MockRepoClient)(nil).GetFileContent), filename)
}
// InitRepo mocks base method.
func (m *MockRepoClient) InitRepo(repo clients.Repo, commitSHA string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "InitRepo", repo, commitSHA)
ret0, _ := ret[0].(error)
return ret0
}
// InitRepo indicates an expected call of InitRepo.
func (mr *MockRepoClientMockRecorder) InitRepo(repo, commitSHA interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitRepo", reflect.TypeOf((*MockRepoClient)(nil).InitRepo), repo, commitSHA)
}
// IsArchived mocks base method.
func (m *MockRepoClient) IsArchived() (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsArchived")
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// IsArchived indicates an expected call of IsArchived.
func (mr *MockRepoClientMockRecorder) IsArchived() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsArchived", reflect.TypeOf((*MockRepoClient)(nil).IsArchived))
}
// ListBranches mocks base method.
func (m *MockRepoClient) ListBranches() ([]*clients.BranchRef, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListBranches")
ret0, _ := ret[0].([]*clients.BranchRef)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListBranches indicates an expected call of ListBranches.
func (mr *MockRepoClientMockRecorder) ListBranches() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListBranches", reflect.TypeOf((*MockRepoClient)(nil).ListBranches))
}
// ListCheckRunsForRef mocks base method.
func (m *MockRepoClient) ListCheckRunsForRef(ref string) ([]clients.CheckRun, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListCheckRunsForRef", ref)
ret0, _ := ret[0].([]clients.CheckRun)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListCheckRunsForRef indicates an expected call of ListCheckRunsForRef.
func (mr *MockRepoClientMockRecorder) ListCheckRunsForRef(ref interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListCheckRunsForRef", reflect.TypeOf((*MockRepoClient)(nil).ListCheckRunsForRef), ref)
}
// ListCommits mocks base method.
func (m *MockRepoClient) ListCommits() ([]clients.Commit, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListCommits")
ret0, _ := ret[0].([]clients.Commit)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListCommits indicates an expected call of ListCommits.
func (mr *MockRepoClientMockRecorder) ListCommits() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListCommits", reflect.TypeOf((*MockRepoClient)(nil).ListCommits))
}
// ListContributors mocks base method.
func (m *MockRepoClient) ListContributors() ([]clients.User, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListContributors")
ret0, _ := ret[0].([]clients.User)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListContributors indicates an expected call of ListContributors.
func (mr *MockRepoClientMockRecorder) ListContributors() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListContributors", reflect.TypeOf((*MockRepoClient)(nil).ListContributors))
}
// ListFiles mocks base method.
func (m *MockRepoClient) ListFiles(predicate func(string) (bool, error)) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListFiles", predicate)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListFiles indicates an expected call of ListFiles.
func (mr *MockRepoClientMockRecorder) ListFiles(predicate interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListFiles", reflect.TypeOf((*MockRepoClient)(nil).ListFiles), predicate)
}
// ListIssues mocks base method.
func (m *MockRepoClient) ListIssues() ([]clients.Issue, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListIssues")
ret0, _ := ret[0].([]clients.Issue)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListIssues indicates an expected call of ListIssues.
func (mr *MockRepoClientMockRecorder) ListIssues() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListIssues", reflect.TypeOf((*MockRepoClient)(nil).ListIssues))
}
// ListReleases mocks base method.
func (m *MockRepoClient) ListReleases() ([]clients.Release, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListReleases")
ret0, _ := ret[0].([]clients.Release)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListReleases indicates an expected call of ListReleases.
func (mr *MockRepoClientMockRecorder) ListReleases() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListReleases", reflect.TypeOf((*MockRepoClient)(nil).ListReleases))
}
// ListStatuses mocks base method.
func (m *MockRepoClient) ListStatuses(ref string) ([]clients.Status, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListStatuses", ref)
ret0, _ := ret[0].([]clients.Status)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListStatuses indicates an expected call of ListStatuses.
func (mr *MockRepoClientMockRecorder) ListStatuses(ref interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListStatuses", reflect.TypeOf((*MockRepoClient)(nil).ListStatuses), ref)
}
// ListSuccessfulWorkflowRuns mocks base method.
func (m *MockRepoClient) ListSuccessfulWorkflowRuns(filename string) ([]clients.WorkflowRun, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListSuccessfulWorkflowRuns", filename)
ret0, _ := ret[0].([]clients.WorkflowRun)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListSuccessfulWorkflowRuns indicates an expected call of ListSuccessfulWorkflowRuns.
func (mr *MockRepoClientMockRecorder) ListSuccessfulWorkflowRuns(filename interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSuccessfulWorkflowRuns", reflect.TypeOf((*MockRepoClient)(nil).ListSuccessfulWorkflowRuns), filename)
}
// ListWebhooks mocks base method.
func (m *MockRepoClient) ListWebhooks() ([]clients.Webhook, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListWebhooks")
ret0, _ := ret[0].([]clients.Webhook)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListWebhooks indicates an expected call of ListWebhooks.
func (mr *MockRepoClientMockRecorder) ListWebhooks() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListWebhooks", reflect.TypeOf((*MockRepoClient)(nil).ListWebhooks))
}
// Search mocks base method.
func (m *MockRepoClient) Search(request clients.SearchRequest) (clients.SearchResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Search", request)
ret0, _ := ret[0].(clients.SearchResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Search indicates an expected call of Search.
func (mr *MockRepoClientMockRecorder) Search(request interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Search", reflect.TypeOf((*MockRepoClient)(nil).Search), request)
}
// URI mocks base method.
func (m *MockRepoClient) URI() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "URI")
ret0, _ := ret[0].(string)
return ret0
}
// URI indicates an expected call of URI.
func (mr *MockRepoClientMockRecorder) URI() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "URI", reflect.TypeOf((*MockRepoClient)(nil).URI))
}