/
refsync.go
204 lines (172 loc) · 6.35 KB
/
refsync.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
// Code generated by MockGen. DO NOT EDIT.
// Source: remote/refsync/types/types.go
// Package mocks is a generated GoMock package.
package mocks
import (
gomock "github.com/golang/mock/gomock"
types "github.com/make-os/kit/remote/refsync/types"
txns "github.com/make-os/kit/types/txns"
reflect "reflect"
)
// MockWatcher is a mock of Watcher interface
type MockWatcher struct {
ctrl *gomock.Controller
recorder *MockWatcherMockRecorder
}
// MockWatcherMockRecorder is the mock recorder for MockWatcher
type MockWatcherMockRecorder struct {
mock *MockWatcher
}
// NewMockWatcher creates a new mock instance
func NewMockWatcher(ctrl *gomock.Controller) *MockWatcher {
mock := &MockWatcher{ctrl: ctrl}
mock.recorder = &MockWatcherMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockWatcher) EXPECT() *MockWatcherMockRecorder {
return m.recorder
}
// Do mocks base method
func (m *MockWatcher) Do(task *types.WatcherTask) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Do", task)
ret0, _ := ret[0].(error)
return ret0
}
// Do indicates an expected call of Do
func (mr *MockWatcherMockRecorder) Do(task interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Do", reflect.TypeOf((*MockWatcher)(nil).Do), task)
}
// Watch mocks base method
func (m *MockWatcher) Watch(repo, reference string, startHeight, endHeight uint64) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Watch", repo, reference, startHeight, endHeight)
ret0, _ := ret[0].(error)
return ret0
}
// Watch indicates an expected call of Watch
func (mr *MockWatcherMockRecorder) Watch(repo, reference, startHeight, endHeight interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Watch", reflect.TypeOf((*MockWatcher)(nil).Watch), repo, reference, startHeight, endHeight)
}
// QueueSize mocks base method
func (m *MockWatcher) QueueSize() int {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "QueueSize")
ret0, _ := ret[0].(int)
return ret0
}
// QueueSize indicates an expected call of QueueSize
func (mr *MockWatcherMockRecorder) QueueSize() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueueSize", reflect.TypeOf((*MockWatcher)(nil).QueueSize))
}
// HasTask mocks base method
func (m *MockWatcher) HasTask() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "HasTask")
ret0, _ := ret[0].(bool)
return ret0
}
// HasTask indicates an expected call of HasTask
func (mr *MockWatcherMockRecorder) HasTask() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasTask", reflect.TypeOf((*MockWatcher)(nil).HasTask))
}
// IsRunning mocks base method
func (m *MockWatcher) IsRunning() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsRunning")
ret0, _ := ret[0].(bool)
return ret0
}
// IsRunning indicates an expected call of IsRunning
func (mr *MockWatcherMockRecorder) IsRunning() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsRunning", reflect.TypeOf((*MockWatcher)(nil).IsRunning))
}
// Start mocks base method
func (m *MockWatcher) Start() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Start")
}
// Start indicates an expected call of Start
func (mr *MockWatcherMockRecorder) Start() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockWatcher)(nil).Start))
}
// Stop mocks base method
func (m *MockWatcher) Stop() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Stop")
}
// Stop indicates an expected call of Stop
func (mr *MockWatcherMockRecorder) Stop() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockWatcher)(nil).Stop))
}
// MockRefSync is a mock of RefSync interface
type MockRefSync struct {
ctrl *gomock.Controller
recorder *MockRefSyncMockRecorder
}
// MockRefSyncMockRecorder is the mock recorder for MockRefSync
type MockRefSyncMockRecorder struct {
mock *MockRefSync
}
// NewMockRefSync creates a new mock instance
func NewMockRefSync(ctrl *gomock.Controller) *MockRefSync {
mock := &MockRefSync{ctrl: ctrl}
mock.recorder = &MockRefSyncMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockRefSync) EXPECT() *MockRefSyncMockRecorder {
return m.recorder
}
// OnNewTx mocks base method
func (m *MockRefSync) OnNewTx(tx *txns.TxPush, targetRef string, txIndex int, height int64, doneCb func()) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "OnNewTx", tx, targetRef, txIndex, height, doneCb)
}
// OnNewTx indicates an expected call of OnNewTx
func (mr *MockRefSyncMockRecorder) OnNewTx(tx, targetRef, txIndex, height, doneCb interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnNewTx", reflect.TypeOf((*MockRefSync)(nil).OnNewTx), tx, targetRef, txIndex, height, doneCb)
}
// Watch mocks base method
func (m *MockRefSync) Watch(repo, reference string, startHeight, endHeight uint64) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Watch", repo, reference, startHeight, endHeight)
ret0, _ := ret[0].(error)
return ret0
}
// Watch indicates an expected call of Watch
func (mr *MockRefSyncMockRecorder) Watch(repo, reference, startHeight, endHeight interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Watch", reflect.TypeOf((*MockRefSync)(nil).Watch), repo, reference, startHeight, endHeight)
}
// CanSync mocks base method
func (m *MockRefSync) CanSync(namespace, repoName string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CanSync", namespace, repoName)
ret0, _ := ret[0].(error)
return ret0
}
// CanSync indicates an expected call of CanSync
func (mr *MockRefSyncMockRecorder) CanSync(namespace, repoName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanSync", reflect.TypeOf((*MockRefSync)(nil).CanSync), namespace, repoName)
}
// Stop mocks base method
func (m *MockRefSync) Stop() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Stop")
}
// Stop indicates an expected call of Stop
func (mr *MockRefSyncMockRecorder) Stop() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockRefSync)(nil).Stop))
}