-
Notifications
You must be signed in to change notification settings - Fork 0
/
swim_node.go
210 lines (166 loc) · 4.28 KB
/
swim_node.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
package mocks
import "github.com/uber/ringpop-go/swim"
import "github.com/stretchr/testify/mock"
import "github.com/uber/ringpop-go/events"
type SwimNode struct {
mock.Mock
}
// Bootstrap provides a mock function with given fields: opts
func (_m *SwimNode) Bootstrap(opts *swim.BootstrapOptions) ([]string, error) {
ret := _m.Called(opts)
var r0 []string
if rf, ok := ret.Get(0).(func(*swim.BootstrapOptions) []string); ok {
r0 = rf(opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(*swim.BootstrapOptions) error); ok {
r1 = rf(opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CountReachableMembers provides a mock function with given fields: predicates
func (_m *SwimNode) CountReachableMembers(predicates ...swim.MemberPredicate) int {
ret := _m.Called(predicates)
var r0 int
if rf, ok := ret.Get(0).(func(...swim.MemberPredicate) int); ok {
r0 = rf(predicates...)
} else {
r0 = ret.Get(0).(int)
}
return r0
}
// Destroy provides a mock function with given fields:
func (_m *SwimNode) Destroy() {
_m.Called()
}
// GetChecksum provides a mock function with given fields:
func (_m *SwimNode) GetChecksum() uint32 {
ret := _m.Called()
var r0 uint32
if rf, ok := ret.Get(0).(func() uint32); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(uint32)
}
return r0
}
// GetReachableMembers provides a mock function with given fields: predicates
func (_m *SwimNode) GetReachableMembers(predicates ...swim.MemberPredicate) []swim.Member {
ret := _m.Called(predicates)
var r0 []swim.Member
if rf, ok := ret.Get(0).(func(...swim.MemberPredicate) []swim.Member); ok {
r0 = rf(predicates...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]swim.Member)
}
}
return r0
}
// Labels provides a mock function with given fields:
func (_m *SwimNode) Labels() *swim.NodeLabels {
ret := _m.Called()
var r0 *swim.NodeLabels
if rf, ok := ret.Get(0).(func() *swim.NodeLabels); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*swim.NodeLabels)
}
}
return r0
}
// MemberStats provides a mock function with given fields:
func (_m *SwimNode) MemberStats() swim.MemberStats {
ret := _m.Called()
var r0 swim.MemberStats
if rf, ok := ret.Get(0).(func() swim.MemberStats); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(swim.MemberStats)
}
return r0
}
// ProtocolStats provides a mock function with given fields:
func (_m *SwimNode) ProtocolStats() swim.ProtocolStats {
ret := _m.Called()
var r0 swim.ProtocolStats
if rf, ok := ret.Get(0).(func() swim.ProtocolStats); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(swim.ProtocolStats)
}
return r0
}
// Ready provides a mock function with given fields:
func (_m *SwimNode) Ready() bool {
ret := _m.Called()
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// AddListener provides a mock function with given fields: _a0
func (_m *SwimNode) AddListener(_a0 events.EventListener) bool {
ret := _m.Called(_a0)
var r0 bool
if rf, ok := ret.Get(0).(func(events.EventListener) bool); ok {
r0 = rf(_a0)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// RemoveListener provides a mock function with given fields: _a0
func (_m *SwimNode) RemoveListener(_a0 events.EventListener) bool {
ret := _m.Called(_a0)
var r0 bool
if rf, ok := ret.Get(0).(func(events.EventListener) bool); ok {
r0 = rf(_a0)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// RegisterSelfEvictHook provides a mock function with given fields: hooks
func (_m *SwimNode) RegisterSelfEvictHook(hooks swim.SelfEvictHook) error {
ret := _m.Called(hooks)
var r0 error
if rf, ok := ret.Get(0).(func(swim.SelfEvictHook) error); ok {
r0 = rf(hooks)
} else {
r0 = ret.Error(0)
}
return r0
}
// SelfEvict provides a mock function with given fields:
func (_m *SwimNode) SelfEvict() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// SetIdentity provides a mock function with given fields: identity
func (_m *SwimNode) SetIdentity(identity string) error {
ret := _m.Called(identity)
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(identity)
} else {
r0 = ret.Error(0)
}
return r0
}